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 ? 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'; } Link to comment https://forums.phpfreaks.com/topic/88757-solved-query-help/#findComment-454616 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.