RE: [PHP] PHP Apache (GLOBALS) question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[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.

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux