Solved

PHP & MySQL

Posted on 2000-02-18
6
366 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
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

747 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now