Wednesday, 29 April 2009

PHP and MySQL database access

I created a database named "mydatabase" and a table named "employees" in MySQL.

I inserted one record into the Employees table and try to execute the PHP script to show the record.

I always get the error message "HTTP 500 - Internal server error..." and then I check the Apache errorlog and find out the real cause is "PHP Fatal error: Call to undefined function mysql_connect()". Finally, after I have read through the following url, I know how to fix the problems now.


http://docs.phplivesupport.com/viewarticle.php?uid=1&aid=73&pid=3

I really don't know why I always engage with the setup problems but really thank God I can resolve them eventually. This is a good exprience.




I insert a new record through "add_record.html".



The new record is uploaded to the table correctly by "add_record.php".

I execute the script show_records.php to display multiple records.

No comments: