>From my experience the php mailing lists & newsgroups are quite actively
monitored and a lot of excellent advice is given there.

What I'd do is check error status after mysql calls (whether while dev'g
code or permanently to make your app stronger).

Check out mysql_error and mysql_errno. Also check return codes from mysql
operations.

Also...as the other fellow mentioned, you probably need to upgrade as mysql
libs are bundled w/my version of php (4.3.2).

I would say you probably don't have mysql libs in your php distro. Create a
php page w/the following:

<?PHP
        phpinfo();
?>

and see what your configuration is.


mike

-----Original Message-----
From: John Cole [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 24, 2003 10:44 AM
To: [EMAIL PROTECTED]
Subject: MySQL connection with PHP


hello,
i am learning PHP and MySQL recently, i use PHP to
connect to MySQL server,
however, an error occur:
"Fatal error: Call to undefined function:
mysql_connect() in /var/... on line 2"

Following is the PHP program:

1  <?php
2  $linkhandle = mysql_connect("192.168.0.1", "john",
"password");
3  $result = mysql_list_dbs($linkhandle);
4  $num_rows = mysql_num_rows($result);

5  while($db_data = mysql_fetch_row($result)) {
6     echo $db_data[0]."<br>";
7     $result2 = mysql_list_tables($db_data[0]);
8     $num_rows2 = mysql_num_rows($result2);
9     while($table_data = mysql_fetch_row($result2)) {
10       echo "--".$table_data[0]."<br>";
11    }
12    echo "==> $num_row2 table(s) in ".$db_data[0].
"<p>";
13 }
14 ?>

PHP version:   4.0.4
MySQL version: 3.23.36-1

But i use the same hostname, username and password
to connect MySQL at client side, it is no problem, so
i don't kown what's wrong in the program.

Can anyone solve my problem, any reply will be
appreciated, thanks.


________________________________________________________________________
Want to chat instantly with your online friends?  Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to