Jump to content

how do i check if a mysql query sent was succesful or not ?


jd2007

Recommended Posts

It should be the same for all queries.

 

<?php

$sql = "UPDATE table SET col = '$var' WHERE condition";
$query = mysql_query($sql);

if ($query){
   echo "Query was successful";
} else {
   echo "Query Failed.";
}

?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.