chand.sethi77 Posted March 25, 2011 Share Posted March 25, 2011 I have this action page after a registration form : <php include("connect.php") ?><?php require("constant.php"); ?><?php//connecting to mysql $connect = mysql_connect(DB_SERVER, DB_USER, DB_PASS); if (!$connect) { die ("Mysql Connection failed. Error is :" .mysql_error() ); }?><?php $firstname = $_POST['firstname'];$lastname = $_POST['lastname'];$username = $_POST['username'];$email = $_POST['email'];$password = $_POST['password'];$age = $_POST['age'];?><?php $db_select = mysql_select_db("chand", $connect); if (!$db_select) { die ("Databse selection failed! :" .mysql_error()); }?><?php $insert = "INSERT INTO users ( firstname, lastname, username, email, password ) VALUES ( '$firstname', '$lastname', '$username','$email', '.md5{$password}' )";if (!$insert) { die ("Error in server! reason : " .mysql_error() );}?> Please tell me what is the problem. It is neither showing any error nor inserting data in ANY database Link to comment Share on other sites More sharing options...
chand.sethi77 Posted March 25, 2011 Author Share Posted March 25, 2011 another question: is it Malito or mailto ? Link to comment Share on other sites More sharing options...
chokk Posted March 25, 2011 Share Posted March 25, 2011 <php include("connect.php") ?> You are missing a "?" and ";" Link to comment Share on other sites More sharing options...
chand.sethi77 Posted March 25, 2011 Author Share Posted March 25, 2011 which "?" Link to comment Share on other sites More sharing options...
chand.sethi77 Posted March 25, 2011 Author Share Posted March 25, 2011 still not working.. no data in databse. Link to comment Share on other sites More sharing options...
chokk Posted March 25, 2011 Share Posted March 25, 2011 I'm on my way out the door. I will test your script in half an hour if noone else has solved your problem in the meantime Link to comment Share on other sites More sharing options...
birbal Posted March 25, 2011 Share Posted March 25, 2011 <?php$insert = "INSERT INTO users ( firstname, lastname, username, email, password ) VALUES ( '$firstname', '$lastname', '$username','$email', '.md5{$password}' )";if (!$insert) { die ("Error in server! reason : " .mysql_error() );} you need to pass the $insert in mysql_quey() http://php.net/function.mysql_query. now it is not even being executed by mysql yet.after that checking the return value of mysql_query() will ensure that query successfuly done or not. Link to comment Share on other sites More sharing options...
chand.sethi77 Posted March 25, 2011 Author Share Posted March 25, 2011 can you write down the code please Link to comment Share on other sites More sharing options...
birbal Posted March 25, 2011 Share Posted March 25, 2011 somethink like.. <?php$insert = "INSERT INTO users ( firstname, lastname, username, email, password ) VALUES ( '$firstname', '$lastname', '$username','$email', '.md5{$password}' )";if (!mysql_query($insert)) { die ("Error in server! reason : " .mysql_error() );}elseecho 'inserted'; Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.