|
-
Mar 19th, 2007, 06:59 AM
#1
Thread Starter
Lively Member
mysql_connect() error
Hi all,
I'm try to run my php code to connect to mysql but it is showing an error
Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\helloSQL.php on line 7
This the code in my file
------------------------------------------------------------------------
<html>
<head><title>PHP and SQL Integration Test</title></head>
<body>
<?php
$link = mysql_connect("localhost", "", "") or die("Could not connect");
print "Connected successfully";
$query = "SELECT now()";
$result = mysql_query($query)
or die("Query failed");
print "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
print "\t<tr>\n";
foreach ($line as $col_value) {
print "\t\t<td>$col_value</td>\n";
}
print "\t</tr>\n";
}
print "</table>\n";
mysql_close($link);
?>
</body>
</html>
------------------------------------------------------------------------
can sombody plz help on this,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Thanks & Regards
manoj
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|