RE: [PHP] PHP Apache (GLOBALS) question
| From: | Jay Blanchard | Date: | Fri, 19 Sep 2003 15:13:24 +0000 |
| Subject: | RE: [PHP] PHP Apache (GLOBALS) question | ||
| Groups: | php.general php.windows | ||
| Request: | Send a blank email to php-general+get-163156@lists.php.net to get a copy of this message | ||
[snip]
...please snip replies....
[/snip]
Your php.ini should be in /etc/apache/
Once you have it there restart your Apache server.
Now, let's creat a MySQL connection string in a seperate file (not in
the php.ini, which acording to some of the stuff I have read you have
done. Also there should not a reference to mysql.sock in the php.ini)
that will return errors to us if it fails;
<?php
if(!($dbconnect = mysql_pconnect("name_of_the_database_server",
"user_name", "password"))){
echo"Failed to connect to database!\n";
echo mysql_error."\n";
exit();
}
if(!mysql_select_db("the_database_you_wish_to_use", $dbconnect)){
"Failed to select database!\n";
echo mysql_error()."\n";
exit();
}
?>
Let us know how this works for you.