|
Posted by davek on 07/14/06 21:35
JDS wrote:
> It is, but in the future, post to both groups AT THE SAME TIME!!!
Sorry, I posted to the other group before I realised there was this
group as well. Will be more careful in future.
Anyway, here's the code that was causing the problem:
1. if (@mysql_query($makechanges)) {
2. echo "<p>$pubname has been added to database</p>";
3. } else {
4. echo "<p>Error updating database: " . mysqlerror() . "</p>";
5. }
Spot the deliberate mistake in line 4!
The reason I hadn't noticed this before was because the if condition
had never returned a false result before! With that fixed, this is the
error message:
Error updating database: Duplicate entry '127' for key 1
ie, for some reason, the INSERT query is trying to enter the new row
with the same primary key as an already existing row, which it
shouldn't be as it's set to auto_increment.
I think this is something for my webhost to sort out. Thanks for your
patience...
David
Navigation:
[Reply to this message]
|