RE: [PHP] SQL update does insert?
| From: | Craig Vincent | Date: | Wed, 12 Jul 2000 12:26:52 +0000 |
| Subject: | RE: [PHP] SQL update does insert? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-6125@lists.php.net to get a copy of this message | ||
<snip>
$q = "update jump set ordinal=$ordinal,label='$label',url='$url' where
idx=$idx)";
$r = mysql_query( $q );
$r seems to come out of this undefined <?>
print $r; gives back nothing.
Echoing the query string looks quite as I expect it should; appropriate
quotes
and string values everywhere. I'm quite baffled.
The idx column is not null auto_increment primary key, ordinal is int(4),
the
other two are varchar.
Guesses and/or clues?
</snip>
That's incredibly bizarre...especially since the UPDATE feature of MySQL
should NEVER do any new record inserts...that's what REPLACE is for :) If
it is trying to actually add a new record there may be a bug either in that
particular version of PHP or perhaps in the MySQL client compiled into PHP.
My best suggestion to you is to at least upgrade to PHP 3.0.16 or better yet
to 4.0.0pl2 using that lastest MySQL client include files.
Have you checked the MySQL logs? Perhaps they can reveal more information
on exactly what PHP is trying to do.
Sincerely,
Craig Vincent