Jump to content

does this reduce performance?


jaikar

Recommended Posts

hi there.

 

in the below case, does it executes the query once / twice ?, does this reduce the performance when used to execute the queries?

 

function db_query($query) {

if(!mysql_query($query)) {

die(redirect_page().'<br>'.$query.'<br>'.mysql_error());

} else {

return mysql_query($query);

}

}

 

Thanks !...

 

Link to comment
https://forums.phpfreaks.com/topic/98119-does-this-reduce-performance/
Share on other sites

  function db_query($query) {
    $res=mysql_query($query);
    $num_rows=mysql_numrows($res);
      if(!$num_rows) {
         die(redirect_page().'
'.$query.'
'.mysql_error());
      } else {
         return $res;
      }
   }

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.