Solved

PHP & MySQL

Posted on 2000-02-18
6
376 Views
Last Modified: 2006-11-17
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
Comment
Question by:shireen_shabbir
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 8

Expert Comment

by:us111
ID: 2534192
It looks as if you don't have mysql compiled with your php.
Download php3 with mysql (look at www.php.net)
0
 

Expert Comment

by:roupik
ID: 2534348
chceck php3.ini in your windows directory

u must have uncommented this :o) !!!

extension=php3_mysql.dll
0
 
LVL 8

Expert Comment

by:us111
ID: 2534363
yes sure
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

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

Try it...
0
 
LVL 2

Expert Comment

by:gravity
ID: 2536050
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
 

Accepted Solution

by:
tejass earned 50 total points
ID: 2539508
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question