rainprop Posted March 9, 2010 Share Posted March 9, 2010 hi, when i try to preview the page, this message appears. how do i solve it? is there any mistake in the input of the codings? basically i just copied the codings from the internet. but there are some chnges that i did. i duno which one is rite or wrong. $qry="SELECT * FROM `user` WHERE login='login' AND password='".md5($_POST['password'])."'"; $result=mysql_query($qry); if($result) { if(mysql_num_rows($result) == 1) { //Login Successful session_regenerate_id(); $member = mysql_fetch_assoc($result); $_SESSION['SESS_USER_ID'] = $member['user_id']; $_SESSION['SESS_EMP_NAME'] = $member['emp_name']; session_write_close(); header("location: member-index.php"); exit(); }else { //Login failed header("location: login-failed.php"); exit(); } }else { die("Query failed"); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/194684-query-failed/ Share on other sites More sharing options...
aeroswat Posted March 9, 2010 Share Posted March 9, 2010 Copied from the internet >< Is this assignment that you are working on due tomorrow? And how long have you had to complete this? Quote Link to comment https://forums.phpfreaks.com/topic/194684-query-failed/#findComment-1023865 Share on other sites More sharing options...
PFMaBiSmAd Posted March 9, 2010 Share Posted March 9, 2010 If you echo mysql_error() as part of your error checking and error reporting logic, it will tell you why the query failed. I'll guess that it is unlikely you have a column named login and the query failed because of that. Quote Link to comment https://forums.phpfreaks.com/topic/194684-query-failed/#findComment-1023867 Share on other sites More sharing options...
rainprop Posted March 10, 2010 Author Share Posted March 10, 2010 SORRY...pls don mistake me...the assignment is not due tomorrow.. it has still got 3 weeks left. but as im redoing it, i tend to have a lot of problem.previously i used the dreamweaver to create the designs where it has helped me to generate the php codings by itself, but now im trying to generate the design woth the php codings.. Quote Link to comment https://forums.phpfreaks.com/topic/194684-query-failed/#findComment-1024083 Share on other sites More sharing options...
rainprop Posted March 10, 2010 Author Share Posted March 10, 2010 thanks aeroswat, and PFMaBiSmAd, i already knew where my mistake is...just found it. thanks again. Quote Link to comment https://forums.phpfreaks.com/topic/194684-query-failed/#findComment-1024096 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.