Hello
I'm working with the api but i have some questions. I have a database with usernames and i want to select the usernames from the mysql database as username in DA.
So this is my scipt for db connect
He selects voornaam(dutch for name) from informatie(dutch for information) (the name what he will select is rutger)
Now I put the api script with it:
When I open this .php page in the browser I get this:
Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /xxxxx/xxxxxx/xxxxx/xxxxxx/public_html/mysql.php on line 34
line 34 is this line: "username" => "$arr["voornaam"]." ";",
What's wrong with this line?
Greetings Rutger
I'm working with the api but i have some questions. I have a database with usernames and i want to select the usernames from the mysql database as username in DA.
So this is my scipt for db connect
Code:
<?php
mysql_connect("localhost", "xxxxxx", "xxxx");
mysql_select_db("xxxxx");
$res = mysql_query("SELECT voornaam FROM informatie");
while ($arr = mysql_fetch_assoc($res)) {
echo $arr["voornaam"]." ";
}
mysql_free_result($res);
He selects voornaam(dutch for name) from informatie(dutch for information) (the name what he will select is rutger)
Now I put the api script with it:
Code:
<?php
mysql_connect("localhost", "xxxxxxx", "xxxxxx");
mysql_select_db("xxxxxxx");
$res = mysql_query("SELECT voornaam FROM informatie");
while ($arr = mysql_fetch_assoc($res)) {
echo $arr["voornaam"]." ";
}
mysql_free_result($res);
include("httpsocket.php");
$sock = new HTTPSocket;
$sock->connect("domain.com",2222);
$sock->set_login("xxxxxx","xxxxxxx");
$sock->set_method("POST");
$sock->query("/CMD_ACCOUNT_USER",
array(
"domain" => "domain.com",
"action" => "create",
"add" => "submit",
"username" => "$arr["voornaam"]." ";",
"email" => "[email protected]",
"passwd" => "123456789",
"passwd2" => "123456789",
"domain" => "domain.com",
"package" => "Linkservice",
"ip" => "xx.xxx.xx.xxx",
"notify" => "yes",
));
$result = $sock->fetch_body();
echo $result;
?>
When I open this .php page in the browser I get this:
Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /xxxxx/xxxxxx/xxxxx/xxxxxx/public_html/mysql.php on line 34
line 34 is this line: "username" => "$arr["voornaam"]." ";",
What's wrong with this line?
Greetings Rutger
Last edited: