• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 387
  • Last Modified:


I am trying to use PHP to enter data into the MySQL database but it gives me an error:

Fatal error: Call to unsupported or undefined function mysql_connect() in C:/WINDOWS/Desktop/Website/insertpersonal.php3 on line 5

This is what I had written:


      $mysql_link=mysql_connect("localhost", "","");
      $mysql_select_db("Recruit", $mysql_link);
      $query="insert into tblPerson values($FName, $LName, $DOB, $POB, $gender, $mstatus, $Nationality, $Email, $User, $Pass, $HomePhone,                   $OfficePhone, $Zip, $City, $State, $Country)";
      $mysql_result=mysql_query($query, $mysql_link);

      print("$affected_rows updated.<BR>\n");

Where have I gone wrong?

BTW I am using Xitami as a Web Server

Awaiting reply as soon as possible.

1 Solution
It looks as if you don't have mysql compiled with your php.
Download php3 with mysql (look at www.php.net)
chceck php3.ini in your windows directory

u must have uncommented this :o) !!!

yes sure
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

probaply you must create a MySQL user, then call mysql_connect with the user's name and password, not with "".

Try it...
What version of PHP are you using ? If it's one of the version 4 betas then you may be out of luck.
As I remember, there is a problem using the mysql functions.
To sort this out, try using version 3.0.14
However, the error message does suggest you've compiled PHP without MySQL support.
I am quite sure that you have not configured PHP properly. You should uncomment the line of loading the mysql library in the file php3.ini in the windows directory. A restart may be necessary after the same. The same problem had occured to my friend. Please note that you may need to give the username as root in the second parameter but that's at a later stage when your mysql starts working in conjuction with PHP3.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now