darksniperx Posted November 26, 2007 Share Posted November 26, 2007 $result = mysql_query("SELECT * FROM feed WHERE feed_id = '$id'"); if(!$result) { die("query unsuccessfull"); } else { echo'queury successfull'; } something along these lines, but to be able to check any kind of query, add, delete, update,... the example above does not work me. Quote Link to comment Share on other sites More sharing options...
revraz Posted November 26, 2007 Share Posted November 26, 2007 What do you want to know, if rows were found or if a connection was made to the DB? Quote Link to comment Share on other sites More sharing options...
darksniperx Posted November 26, 2007 Author Share Posted November 26, 2007 if query was successfull, meaning there were no errors during query, and if rows were found or not Quote Link to comment Share on other sites More sharing options...
trq Posted November 26, 2007 Share Posted November 26, 2007 <?php $sql = "SELECT * FROM feed WHERE feed_id = '$id'"; if ($result = mysql_query($sql)) { // query was successfull. if (mysql_num_rows($result)) { // rows were found, fetch array and display result. } else { echo "No rows found"; } } else { echo "Query failed<br />$sql<br />" . mysql_error(); } ?> Quote Link to comment Share on other sites More sharing options...
darksniperx Posted November 26, 2007 Author Share Posted November 26, 2007 thx, that is all that I needed! Quote Link to comment 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.