ShaolinF Posted January 31, 2008 Share Posted January 31, 2008 Hi Guys, I have the following query: $txn_query = mysql_query("SELECT txn_id FROM purchase WHERE txn_id = $_POST['txn_id']"); Now, what I want to do is if txn_id is found in the DB then I want to output an error. How can I do this ? Quote Link to comment https://forums.phpfreaks.com/topic/88757-solved-query-help/ Share on other sites More sharing options...
elpaisa Posted January 31, 2008 Share Posted January 31, 2008 $txn_query = mysql_query("SELECT txn_id FROM purchase WHERE txn_id = $_POST['txn_id']"); $row = mysql_num_rows($txn_query); if($row) { echo' error'; } Quote Link to comment https://forums.phpfreaks.com/topic/88757-solved-query-help/#findComment-454616 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.