Re: [PHP-DB] Re: SQL Insert INTO question

2005-12-08 Thread Graham Cossey
How about: $review = $_POST['review']; $sql = "SELECT * FROM reviews WHERE review_id = '$id'"; $res = mysql_query($sql) or die ("Query failed: " . mysql_error()); if (mysql_num_rows($res) > 0) { $sql_upd = "UPDATE reviews SET review_text = '$review'

Re: [PHP-DB] Re: SQL Insert INTO question

2005-12-08 Thread dpgirago
In full agreement here. I scratched my head this morning, then looked up "INSERT" in the MySQL Docs for a sanity check. It must be an UPDATE statement to work as indicated below. David << Sorry David Mitchell >> == Is that

Re: [PHP-DB] Re: SQL Insert INTO question

2005-12-08 Thread David Mitchell
Is that a syntax supported by MySQL? That is, an INSERT with WHERE clause? I tried it against Oracle, and it doesn't work (can you imagine how upsetting it would have been to have learned that, after having worked with SQL for several years, one can do an update using an INSERT statement?). I'm pr