RE: [PHP-WIN] Managing SQL errors in php pages

From: Date: Fri, 20 Apr 2001 11:57:19 +0000
Subject: RE: [PHP-WIN] Managing SQL errors in php pages
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-6918@lists.php.net to get a copy of this message
Olivier, One way is simply to test for success and produce the appropriate error message if it doesn't work; $result = mysql_query ($query) or die ("appropriate error message"); Matt -----Original Message----- From: Olivier Botineau [mailto:obotineau@noos.fr] Sent: 20 April 2001 13:46 To: PHP Windows list (Adresse de messagerie) Subject: [PHP-WIN] Managing SQL errors in php pages hi is there a way to get control when an error occurs executing sql querry? I mean to have a detailled message like in phpMyAdmin. When I do in my php page ( table t_reffet doesn't exist, thats for the purpose ) : $query_effet = "SELECT t_effet.lib_effet FROM t_reffet, tr_scene_effet, t_scene " . "WHERE t_effet.num_effet = tr_scene_effet.num_effet " . "AND tr_scene_effet.num_scene = $selScene ". "AND tr_scene_effet.num_scene = t_scene.num_scene " . "ORDER BY t_effet.lib_effet ASC "; //print $query_effet; $result_effet = mysql_db_query( $db, $query_effet ); while( $ligne_effet = mysql_fetch_array( $result_effet ) ) { ... I get a warning: Warning: Supplied argument is not a valid MySQL result resource in e:\wwwphp\test\3ds\download\download.php on line 102 Whereas in phpMyAdmin I get: Error SQL-query: SELECT t_effet.lib_effet FROM t_reffet, tr_scene_effet, t_scene WHERE t_effet.num_effet = tr_scene_effet.num_effet AND tr_scene_effet.num_scene = 6 AND tr_scene_effet.num_scene = t_scene.num_scene ORDER BY t_effet.lib_effet ASC MySQL said: Table 'db_web.t_reffet' doesn't exist -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net For additional commands, e-mail: php-windows-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.windows (#6918) next »