Forum Moderators: coopster
The reason i was getting the error was beacuse i was using
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
instead of
$connection = mysqli_connect($host, $user, $pass) or die ("Unable to connect!");
but now when i try and post i get the following error.
Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\connection.php on line 16
Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in C:\wamp\www\connection.php on line 16
Unable to select database!
---------------------
connection.php
---------------------
<?php
$host = "localhost";
$user = "root";
$pass = "**********";
$db = "********";
// open connection
$connection = mysqli_connect($host, $user, $pass) or die ("Unable to connect!");
// select database
mysql_select_db($db) or die ("Unable to select database!");
?>
I could not get WAMP to work, so i downloaded
Apache 2.0.55
PHP5
mysql
phpmyadmin
I thought i had configed every thing right but when i run any php page i get the contens of the php page displayed
example phpinfo script
<?php
phpinfo();
?>
and this is what is displayed on screen
<?php
phpinfo();
?>
any ideas?
So here's what you need to add to your httpd.conf file in order to load php5:
# For PHP 5 do something like this:
Search for 'LoadModule' and add this line after the other modules:
LoadModule php5_module "c:/php/php5apache2.dll"
Substituting C:/php/ for your own path
Search for 'AddType' and add this line after the others:
AddType application/x-httpd-php .php
Then go to the very end of your httpd.conf file and add this:
PHPIniDir "C:/php"
Substituting C:/php for your actual path that contains php.ini
Hope this helps!
Also, in php.ini you'll need to enable the extension for mysql...So search for
php_mysql.dll
And uncomment that line.
Regards,
Ken
P.S. - If you don't want to compile by yourself, I suggest using NetServer (search for it or look on HotScripts.com), it works pretty good.