I done a echo of Mysql_error and it returned: 'Nenhum banco de dados foi selecionado'
(I have the mysql server in portuguese, but the translation is something like 'no db was selected') ----- Original Message ----- From: "David Freeman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, January 05, 2003 10:29 PM Subject: RE: [PHP] Re: PHP and MySQL bug > > > @MYSQL_QUERY("UPDATE d SET h='$h' WHERE id='$id'"); // this > > query doesn't work!!!! > > Personally, I'd call it bad programming practice to do a database update > and not check to see if it worked or not. In this case, how are you > determining that the query did not work? Are you manually checking the > database? You don't have anything in your code to check the status of > this query. > > Perhaps this might get you somewhere: > > $qid = @mysql_query("UPDATE d SET h = '$h' WHERE id = '$id'"); > > if (isset($qid) && mysql_affected_rows() == 1) > { > echo "query executed"; > } else { > echo "query failed: " . mysql_error(); > } > > At least this way you might get some indication of where the problem is. > > CYA, Dave --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php