MySQL Forums
Forum List  »  Connector/ODBC

Test MySQL Connection
Posted by: Nancy LaPoint
Date: May 13, 2005 09:00AM

I have the book PHP and MySQL for Dummies. Apparently I'm worse than a 'dummy' because I'm only as far as testing the MySQL connection and I can't get it figured out.

Here's where I'm at:

<!-- mysql_up.php -->
<?php
$host="localhost";
$user="test";
$password="test";
mysql_connect($host,$user,$password);
$sql="show status";
$result = mysql_query($sql);
if ($result == 0)
echo "<b>Error " . mysql_errno() . ": "
. mysql_error() . "</b>";
else
{
?>

And here's what I'm getting as an error message:

Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\wwwroot\PHP\Connections\TMPd5ubagfo5y.php on line 9

-- this is line 9 in my code:

mysql_connect($host,$user,$password);

What do I need to change?

Options: ReplyQuote


Subject
Written By
Posted
Test MySQL Connection
May 13, 2005 09:00AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.