Solved

PHP & MySQL

Posted on 2000-02-18
6
377 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses four methods for overlaying images in a container on a web page
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 dynamically set the form action using jQuery.

623 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