geekgirl1 wrote:
First time poster.
This is the problem. I want to add the value of $_POST[review] to the
reviews table where the unique id from the reviews table equals the
review id on my form. The statement below does not work. Should I
use UPDATE instead?
INSERT INTO reviews
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
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 a
snip
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'