I am creating a project using php in eclipse and neo4j. I am having problems connecting though. This is the code I have written to connect to the database.
<?php
include("neo4jphp.phar");
use Everyman\Neo4j\Client;
$neo4jClient = new \Everyman\Neo4j\Client('https://127.0.0.1:7474',7474);
$neo4jClient->getTransport()
->setAuth('username','password')
->getTransport()->useHttps();
and here is the link to show the error I am having.
Link: https://selene.hud.ac.uk/irr/connect.php
According to my research this should be correct. I am also using this video to help me with the connection: https://vimeo.com/125334699
Some guidance in the right direction using my code will be appreciated.
Related
Having an issue trying to use a MicroTik API to issue a /tool fetch command and download a file to a router. I am using a ccr1016 on 6.47.9.
My php script calls this API:
require('lib/routeros.class.php');
The code I am using currently is this:
$fileUrl = "http://".$localIP."/".$remoteSysModel."/".$fileName;
$remoteAPI->write('/tool fetch', false);
$remoteAPI->write('=url='.$fileUrl.'');
Also tried:
$remoteAPI->write('/tool fetch url='.$fileUrl.'');
Both of the above are unsuccessful nothing downloads. Any advice much appreciated.
The API is definitely connecting correctly because i retrieve info from the router using this commend $remoteAPI->comm('/system/routerboard/print'); earlier in the script.
The $fileUrl variable is correct as well and contains this string http://172.27.55.120/rb2011/routeros-verv-6.47.9.npk
Also if i run the command /tool fetch url=http://172.27.55.120/rb2011/routeros-verv-6.47.9.npk in the router cli through winbox, it works correctly and the file downloads.
Any help would be greatly appreciated.
Thanks in advance
I have no idea about PHP programming before. Now I am working on selenium using Facebook php web driver. I have just started with very basic test code that is to open pages and click links and so on. But I got stuck just after few lines of code and it shows a parse error. I couldn't find what the parse error is? It would really grateful if someone can help me out. Here is my few lines of code..
<?php
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;
require_once 'vendor/Autoload.php';
$host = 'http://localhost:4444/wd/hub'; // this is the default
$capabilities = DesiredCapabilities::firefox();
$driver = RemoteWebDriver::create($host, $capabilities, 5000);
$driver->get('http://qa.practera.com');
$link =$driver>findElement(WebDriverBy::xpath('//a[#href='login']'));
$link->click();
?>
Result:
Parse error: parse error in
/Users/srujanareddyenugala/Desktop/php-webdriver/1.php on line 14
I am an intern and trying to learn by looking at some examples because my mentor just want me to learn by myself. I want to start from basics but they are not giving me enough time and wants me to do just by going through examples and understand. It will be very helpful if someone can help me by giving advices how to learn quickly and also could suggests me with some websites or books or online courses.
Thanks in advance!!
This line
$link =$driver>findElement(WebDriverBy::xpath('//a[#href='login']'));
To
$link =$driver->findElement(WebDriverBy::xpath('//a[#href='login']'));
you are missing a - sign
I was trying to query data from Couchbase server using PHP and N1QL. Please see the code below.
<?php
$cluster = new CouchbaseCluster('127.0.0.1:8091');
$bucket = $cluster->openBucket('travel-sample');
$q = CouchbaseN1qlQuery::fromString("SELECT * FROM `travel-sample`")->consistency(CouchbaseN1qlQuery::REQUEST_PLUS);
$res = $bucket->query($q);
var_dump($res);
?>
Unfortunately, this return NULL. I am usinf Couchbase server 3.0 and PHP SDK. Cam someone help me to correct my N1QL query ?
Regards,
Tismon Varghese
First of all, i was using Couchbase 3.0, so i'm suppose to use N1QL DP3. So i downloaded DP3 from the below URL
https://s3.amazonaws.com/query-dp3/couchbase-query_dev_preview3_x86_win.zip
Extract it, put it on the directory where Couchbase installed (This is not necessary i guess). Extracted directory contains two directories; data and static in addition to a start_turotial.bat and some other files.
Since the .bat file is connected to data directory, we have to change this to get data from Couchbase server. For that, do the following.
Take a backup of the .bat file; right click on it and select 'edit'
change the line cbq-engine -couchbase dir:data to cbq-engine -couchbase http://127.0.0.1:8091/ and save it
Double click on the bat file so that a console window will be popped up (This should be open as long as the query runs). I addition to this, a webpage also opens automatically in your browser; if not, follow the instruction on the popped console window.
..and you are good to go!!!
Regards,
Tismon Varghese.
I wanted to connect to the MongoDB which is installed in windows server from ubuntu using php.
I am trying to connect using the following code but output is nothing even mongoexception is not throwing any error.
$mngo = new Mongo("mongodb://192.168.1.119:27017");
$db = $mngo->selectDB('travelmanagement_qa');
Can anyone please tell me why i am not able to connect?
Thank You in advance
A few comments:
Please use new MongoClient instead of new Mongo.
This should not output anything at all. You're just selecting a database and assigning it to a variable. Is that your whole code snippet?
What did you expect the output to be?
To figure out what is actually happening under the hood with connections you can use MongoLog. With this functionality you can track down what the driver is doing internally. You'd use it like:
MongoLog::setLevel(MongoLog::ALL);
MongoLog::setModule(MongoLog::RS);
MongoLog::setCallback( 'printMsgs' );
function printMsgs($a, $b, $msg)
{
echo $msg, "\n";
}
I have created a login_activity for my android app. I've gone through quite a few tutorials on how to fetch data from an external MySQL database. I have access to this external MySQL database. I've followed one of them to write the following PHP code which will fetch my data from the server for my login_Activity:
<?php
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
$dbhost="localhost";
$dbuser="";
$dbpass=""
$connect=mysql_connect($dbhost,$dbsuer,$dbpass) or die("database selection error");
$username=$_POST['username'];
$password=$_POST['password'];
$query=mysql_query("SELECT * FROM app_users_parent where Email='$username' AND Password='$password');
$num=mysql_num_rows($query);
if($num==1) {
while($list=mysql_fetch_assoc($query)) {
$output=$list;
echo json_encode('$output');
}
mysql_close();
}
?>
I understand I've got to place this php file onto the same server. But I don't really understand how to do that? Should I use something like FileZilla for FTP or what?
I could not find any tutorial on the net which shows how and where to save this php file.
If you need my Java code where I'm connecting to this file,I could give it to you.
(P.S.- I just started with android so not really a pro out here. Please respect that )
How to connect Android with PHP, MySQL tutorial definitely help you. Good luck.
Yes, you have to upload your .php file onto your server (wich contain the MySQL database).
Then, in you android class, create an asynctask class. That aynsctask class have to request your phpfile an get the json.