REPLACE problem
| From: | Daniel Alsén | Date: | Wed, 03 Oct 2001 08:05:13 +0000 |
| Subject: | REPLACE problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-69727@lists.php.net to get a copy of this message | ||
Hi,
i need help with a, seemingly, simple problem...
I have a form that is supposed to update a MySql table with only two fields
(id and show_id). I use show_id to determine what is showing on my first
page and never store more than one value in the table.
Now - i cant seem to get the REPLACE to work. First it only added more rows
in the table with a new value each time. I solved that by inserting
I inserted a hidden value into the form to make sure that the correct (and
only) value will be replaced:
<input type="hidden" name="fid" value="1">
But, that´s when it stopped working.
Show_id is determined by radio buttons in the form and that part is working.
In the actual query i REPLACE the value of show_id:
$query = "REPLACE INTO puff";
$query .= "(id, show_id)";
$query .= " values('$fid''$show_id')";
I am sure it´s a simple solution. But please point it out for me.
Regards
# Daniel Alsén | www.mindbash.com #
# d@mindbash.com | +46 704 86 14 92 #
# ICQ: 63006462 | #