"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Oops, I forgot the mysqli_error() needs the link as the argument:
PHP Code:
mysqli_error($dbc)
However, I'm pretty sure the problem is that you need a column name in your WHERE clause, not the keywords PRIMARY KEY.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Probably it is a reserved word. But you could still use it if you wanted to by "quoting" it with back-ticks (a.k.a. left quotes):
Code:
. . . WHERE `index` = . . .
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
I have had problems in the past when deleting a row where the index was being auto incremented. It seemed the numbers got all bollixed up. I don't recall the exact problem now, but I ended up adding a column that indicated whether the row was active or not; ActiveID = 0 (inactive), 1 (active). Then added to queries ... WHERE ActiveID = 1 AND ...
Bookmarks