Hey guys.
I recently began with php/mysql programming together with a book. But when I got to chapter 4 it wants me to make a database connection so I thought oh cool
but after trying hours and hours I don't get my code to work. Although the php works just fine
I used the following code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>multipurpose page outline</title>
</head>
<body>
<?php
$dbcnx = @mysql_connect("192.168.1.4", "root", "rodney28");
if (!$dbcnx) {
exit('unable to get to the database');
}
if (!@mysql_select_db('ijdb')) {
exit('<p> unable to locate the joke database at this time</p>');
}
?>
</body>
</html>and the only thing i get is the "unable to get to the database" I also tried to remove the @ which resulted the same
and used the following code:
<?php
mysql_connect("192.168.1.4", "root", "rodney28") {
or die(mysql_error());
}
?>and this one resulted in a blank page not displaying anything :s
If anyone could help me with this, I would be really grateful
oh if it might help, I use apache 2.0 mysql 4.1 and php 4.3 on a linux server and i write my php scripts on windows which i upload to my linux server