now THAT is confusing for on the fly browsing...hehLiLpunkSkateR wrote:mine would beCode: Select all
<?php //8 lines if (mysql_query($resultSQL)) { return TRUE; } else { return FALSE; } if (mysql_query($resultSQL)) { return TRUE; } else { return FALSE; } if (mysql_query($resultSQL)) { return TRUE; } else { return FALSE; } ?>
Which one is the best?
Moderator: General Moderators
- devork
- Forum Contributor
- Posts: 213
- Joined: Fri Aug 08, 2003 6:44 am
- Location: p(h) developer's network
mine most of the time
Code: Select all
<?php
if ( mysql_query($query) ){
return true;
}else{
return false;
}
#and
$result = mysql_query($query) or die("$query has Error:".mysql_error() ) ;
?>- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
I'd probably do:
or like Weirdan use forced type-casting (bool).
Mac
Code: Select all
return (mysql_query($query)) ? true : false;Mac