Hi Nick,
did you double-check your query ($qry)? Run it from the mysql client or
from phpMyAdmin to make sure its returning some rows of data.
Cheers,
Bart
Nick Wilson wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi all
> Can anyone see any reason why this function does not appear to be
> returning true? It appears to be returning 1 though?
>
> [snip snip]
>
> if(!$this->_db_connect()) {
> return FALSE;
> }
>
> if(!($result=mysql_query($qry))) {
> return FALSE;
> } else {
>
> /* Set properties */
> $this->set_content_table($content_table);
> $this->set_tip_section($section);
> $this->set_auth_id($auth_id);
> $this->set_tip_id(mysql_insert_id());
> $this->set_tip_title($title);
> $this->set_tip_description($desc);
> $this->set_tip_keywords($keywords);
> $this->set_tip_text($text);
> return TRUE;
> }
> return TRUE;
> }
>
>
> the way I'm testing the condition is like:
>
> $test=myfunction();
>
> if($test) {
> do x
> } else do y
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php