Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 382
  • Last Modified:

PHP & MySQL

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:

<?
      $gender=document.personal.Gender.value;
      $mstatus=document.personal.MStatus.value;

      $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);

      $affected_rows=mysql_affected_rows($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.

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

u must have uncommented this :o) !!!

extension=php3_mysql.dll
0
 
us111Commented:
yes sure
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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

Try it...
0
 
gravityCommented:
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.
0
 
tejassCommented:
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.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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