Page 1 of 1

PHP Gurus...

PostPosted: Fri Jul 14, 2017 12:25 pm
by David de Argentina
Hi overthere,

I'm trying to automatize a PHP program for diferent users/servers/databases.

I had uploaded a files with dbname, dbserver, dbuser & dbpass values.

In fact, all appairs good.

Now, i'm trying to insert someting like this into the php's program:

Syntax: [ Download ] [ Hide ]
Using PHP Syntax Highlighting
header("Access-Control-Allow-Origin: *");
$config = include_once('');
echo "<br/><br/>";

$link = mysql_connect($config['dbserver'], $config['dbuser'], $config['dbpass']) or die('Could not connect: ' . mysql_error());
mysql_select_db($config['dbname']) or die('Could not select database');

$query = 'select * from Clients order by name asc' ;
$result = mysql_query($query) or die('Query failed: ' . mysql_error());

while ($fila = mysql_fetch_array($result, MYSQL_BOTH)) {
       echo $fila["id"] . ' - ' . $fila["nombre"];

Parsed in 0.063 seconds, using GeSHi

But something is wrong, i receive this message:
"Could not connect: No such file or directory"

Any ideas?

Thanks in advance,
David de Argentina

Re: PHP Gurus...

PostPosted: Fri Jul 14, 2017 3:37 pm
by David de Argentina
Solved using another way...

Thanks again...

David de Argentina