Page 1 of 1

if statements...

Posted: Mon Oct 29, 2007 7:16 pm
by hgmmy
I got what I hope to be a quick question with a quick answer. Here's the example I'm going to reference for my question.

Code: Select all

<?php 
include('wp-config.php'); //this is were the database connection info is as well as were it connects

  $o_theuser = $_POST['theuser'];
  $o_profile = $_POST['profile'];

$update_profile = mysql_query("UPDATE user_allow SET share_info='$o_profile' WHERE ID='{$cur_user_i}' AND reviewers_id='$o_theuser' ");

  if ($o_profile == 'y' || $o_profile == 'n')
 {
  if ($update_profile)
  {
   echo "successful query";
  }

 } else {
 echo "unsuccessful query";
};
?>
My question is this: If for a condition for an "if statement" I use a variable that contains a mysql_query (like the one above) will it return true if the query complete successfully and false if it returned unsuccessful, and if not what does it take to have a condition that works that way?