note 35391 deleted from function.return by vincent

From: Date: Fri, 29 Aug 2003 13:55:12 +0000
Subject: note 35391 deleted from function.return by vincent
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-55302@lists.php.net to get a copy of this message
Note Submitter: wolfgang.illmeyer@gmx.net ---- It seems like you can't return (MySQL-result-)resources. I just wanted to use this function to simplify error checking in my app: <?php function db_query($query) { return mysql_query($query) or die("Bad Query: $query;".mysql_error()); } ?> but I could not use the return value of this function, because the mysql stuff complained about the validity of the result resource. If I replace any db_query() call with mysql_query(), everything works nicely.

« previous php.notes (#55302) next »