skipping an if statement/logic error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

what happens if you use the following?

Code: Select all

$query = "UPDATE freshwater_report SET lake_id = '$lake_id', author_id = '$auth_id', date_fished = '$date_for_query', fish_report = '$fish_report'
              WHERE lake_id = '$lake_id' AND report_id = report_id";
echo '<!-- ', htmlentities($query), '-->'; // output the query as html-comment only visible in the client's source view
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
echo "The Fishing report was updated successfully.", mysql_affected_rows()," records have been updated <a href='index.php'>Go back to the main menu</a>.";
if 0 records have been updated open the source view and take a look at the echoed query-string.
remove the comment when the script's done.
AND report_id = report_id
sure that correct?
Post Reply