Hi overthere,
I'm trying to automatize a PHP program for diferent users/servers/databases.
I had uploaded a config.inc.php 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=php]<?php
header("Access-Control-Allow-Origin: *");
$config = include_once('config.inc.php');
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');
mysql_set_charset('utf8');
$query = 'select * from Clients order by name asc' ;
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
mysql_set_charset('utf8');
while ($fila = mysql_fetch_array($result, MYSQL_BOTH)) {
echo $fila["id"] . ' - ' . $fila["nombre"];
}
mysql_free_result($result);
mysql_close($link);
?>[/syntax]
But something is wrong, i receive this message:
"Could not connect: No such file or directory"
Any ideas?
Thanks in advance,
David de Argentina
PHP Gurus...
Moderator: Neosoft Support
-
- Posts: 1596
- Joined: Mon Apr 04, 2005 4:13 pm
- Location: Buenos Aires, Argentina
- Contact:
-
- Posts: 1596
- Joined: Mon Apr 04, 2005 4:13 pm
- Location: Buenos Aires, Argentina
- Contact:
Re: PHP Gurus...
Solved using another way...
Thanks again...
David de Argentina
Thanks again...
David de Argentina