I'm trying to check if my SQL query returned a result, and if everything is working well..
I'm doing that to validate one INSERT Query.
$insert = "INSERT INTO offers (status, description logo) VALUES
'" . safe($add['status'][$key]) . "',
'" . safe($add['description'][$key]) . "',
'" . safe($add['logo'][$key]) . "')";
$send = db_query($insert, '+');
The db_query($insert, '+') comes from a switch statement that i created, to not repeat the same thing over and over again:
case '+':
while ($resultset = mysql_fetch_row($q)) {
$val[] = $resultset[0];
}
break;
To validate my Query, i use this:
if(!$send){
echo 'something went wrong';
} else {
echo 'everything is ok';
}
But it show me the same message "everything is ok", even when i put something wrong on my Query:
$insert = "INSET INTO offers (statOs, description logo) VALUES
'" . safe($add['status'][$key]) . "',
'" . safe($add['description'][$key]) . "',
'" . safe($add['logo'][$key]) . "')";
How can i fix that?