blink359 Posted May 4, 2009 Share Posted May 4, 2009 Right being new to PhP i dont know where and how to find out how to stop a script properly if i had a mysql query i want to know how to check if its done its job and if not how to display the appropriate problem message. At the moment i want to do this for a mysql select command, a mysql update command and a mysql insert command example if($success); { $query = "SELECT `login` FROM `accounts` WHERE login='$login' AND password='$pass'"; $result=mysql_query($query); if that doesnt work it echos invalid username or password $query = "UPDATE accounts SET flags = '".$flag."' WHERE login = '".$user."';"; $result = mysql_query($query) if that works it echos something if it doesnt work it echos something else $result = mysql_query("INSERT INTO `accounts` VALUES ('', '$user', '$pass2', '', '', '0', '9', '', '', '$flag', 'enUS', '0', null);") if that works it echos something if not something else but if they dont do what there ment to the end maby a die involved or something? Thanks Blink359 Quote Link to comment https://forums.phpfreaks.com/topic/156793-problem-messages/ Share on other sites More sharing options...
mapleleaf Posted May 4, 2009 Share Posted May 4, 2009 Look in the database to see if the change has happened and make sure error reporting is on: error_reporting(E_ALL); Quote Link to comment https://forums.phpfreaks.com/topic/156793-problem-messages/#findComment-825737 Share on other sites More sharing options...
Ken2k7 Posted May 4, 2009 Share Posted May 4, 2009 Read up the function mysql_query(). You don't have to stop a script. PHP and other languages executes functions and wait for one to finish before going to the next. So if mysql_query() takes 10 mins to run, the rest of the script will have to wait 10 mins. You don't have to stop it yourself. Quote Link to comment https://forums.phpfreaks.com/topic/156793-problem-messages/#findComment-825739 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.