Source language: Translate to:

PHP Gurus...

Questions and information about creating Internet aware NeoBook applications. Including PHP, HTML, FTP, HTTP, Email, etc.

Moderator: Neosoft Support

PHP Gurus...

Postby David de Argentina » Fri Jul 14, 2017 12:25 pm

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: [ Download ] [ Hide ]
Using PHP Syntax Highlighting
<?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);
?>
Parsed in 0.064 seconds, using GeSHi 1.0.8.10


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

Any ideas?

Thanks in advance,
David de Argentina
User avatar
David de Argentina
 
Posts: 1547
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Re: PHP Gurus...

Postby David de Argentina » Fri Jul 14, 2017 3:37 pm

Solved using another way...

Thanks again...

David de Argentina
User avatar
David de Argentina
 
Posts: 1547
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina


Return to NeoBook and the Internet

Who is online

Users browsing this forum: No registered users and 1 guest

cron