Solved

PHP & MySQL

Posted on 2000-02-18
6
373 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
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!

 

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

Suggested Solutions

Title # Comments Views Activity
Wordpress Pagination 1 44
PHP website on Linux - server DNS address could not be found. 18 83
PHP 5.6 and 7.x 4 39
Session time out quickly. 6 26
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

756 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