atal error call to undefined function mysql_connect'

Problems with the Windows version of XAMPP, questions, comments, and anything related.

atal error call to undefined function mysql_connect'

Postby littleimps » 01. June 2010 17:43

Hi,

I cant insert record into mysql.It has an error of 'fatal error call to undefined function mysql_connect'(in connectWrite.php). Anyone know how to solve this issue?


//mysqlWrite.php
Code: Select all
<?php

require ("connectWrite.php");

$insertRec = mysql_query ("INSERT INTO memeber VALUES ('007','Linc','Apple','apple@com','password','12345678','M')") or die (mysql_error());

echo '1 record inserted';

?>




//connectWrite.php
Code: Select all
<?php

$connect = mysql_connect("localhost") or die (mysql_error()); // error over here

mysql_select_db("bookdatabase") or die (mysql_error());

echo "connectedWrite";

?>
littleimps
 
Posts: 7
Joined: 01. June 2010 17:28

Re: atal error call to undefined function mysql_connect'

Postby MC10 » 02. June 2010 05:23

I'm pretty certain you have to state what user/password and database you're using. Also, are the MySQL functions on (in php.ini)?
MC10
 
Posts: 148
Joined: 20. February 2010 20:13

Re: atal error call to undefined function mysql_connect'

Postby peterwt » 02. June 2010 11:37

As MC10 said your mysql_connect is not complete.
The general form for mysql_connect is

Code: Select all
$connect = mysql_connect('localhost', 'mysql_user', 'mysql_password')


where mysql_user is a valid database user name
and mysql_password is a valid password for mysql_user

Peter
Peter
peterwt
 
Posts: 42
Joined: 17. March 2009 11:06
Operating System: Windows 7 64 bit Professional

Re: atal error call to undefined function mysql_connect'

Postby littleimps » 22. June 2010 11:46

TKS alot. Problem Solved. =)
littleimps
 
Posts: 7
Joined: 01. June 2010 17:28


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 48 guests