Replace Error

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
Zoram
Forum Contributor
Posts: 166
Joined: Sun Aug 18, 2002 3:28 pm
Location: Utah
Contact:

Replace Error

Post by Zoram »

Ok, Here is my code...

Code: Select all

REPLACE INTO `Articles` (`article_num`, `state`, `area`, `name`, `author`, `issue`, `desc`, `article`) VALUES (`". $_POSTї'id'] ."`, '$state', '$area', '$name', '$author', '$issue', '$desc', '$article');
How do i make it replace the row? if i take off the `article_num` and (`". $_POST['id'] ."` then it makes a new one but how do i replace it so that it replaces the old one?
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Try

Code: Select all

REPLACE INTO Articles VALUES ('', '{$_POSTї'id']}', '$state', '$area', '$name', '$author', '$issue', '$desc', '$article');
User avatar
Zoram
Forum Contributor
Posts: 166
Joined: Sun Aug 18, 2002 3:28 pm
Location: Utah
Contact:

Post by Zoram »

That didn't quite work, but when i took out the empty ' ', at the first it worked fine.

Thanks!
Post Reply