PHP MySQL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Gui
Forum Newbie
Posts: 2
Joined: Tue Sep 10, 2013 2:59 am

PHP MySQL

Post by Gui »

hi all,

I'm a beginner...Anyone can fix this error..
! ) Fatal error: Call to undefined function mysql_connect_error() in C:\wamp\www\Members\insert.php on line 3
Call Stack
# Time Memory Function Location
1 0.0007 248264 {main}( ) ..\insert.php:0


this is my script:

<?php
mysql_connect("localhost","root","","eSample");
if (mysql_connect_error())
{
echo "Failed to Connect!" .mysql_connect_error();
}

mysql_query("INSERT INTO members (Username, Password)
Values ('$_POST[Username]','$_POST[Password]')");
if (mysql_query())
{
die('Error:' .mysql_error());
}
echo "Record Added!";

mysql_close();
?>
Last edited by califdon on Fri Oct 04, 2013 2:13 pm, edited 1 time in total.
Reason: This thread has been split from another topic, creating this new topic. Please don't introduce new questions in an existing topic. Thank you.
Gui
Forum Newbie
Posts: 2
Joined: Tue Sep 10, 2013 2:59 am

Re: PHP MySQL

Post by Gui »

Tnx, i'v rather replace mysql_connect() instead of mysql_connect_error() then i put $this sign in condition. I can add my newacct now..
Post Reply