?php $link = dbx_connect( DBX_ODBC, "", "db", "username", "password") or die("Could not connect"); $result = dbx_query($link, 'SELECT id, parentid, description FROM table'); if (is_object($result)) {/ /... do some stuff here, see detailed examples below... / / first, print out field names and types / / then, draw a table filled with the returned field values} else if ($result == 1) {echo("Query executed successfully, but no result set returned");} else {exit("Query failed");} dbx_close($link);?
dbx_query() retourne une ressource dbx_result_object ou 1 en cas de succès (un objet de résultat ne sera retourné que pour les requêtes SQL qui retournent un résultat), ou 0 en cas d 'erreur.