This is got to be something really really silly but I've now been banging my head off a desk for 5 hours with it.
Heres my code.
Which is linked to a simple form for adding/ updating news items. When adding a new item it works a treat, no problems.
When amending an item, nothing happens. I dont get an error message and the echo produces:
Record 43 definitely exists (its the one I just successfully added).
If I copy the echo above and paste it directly into the SQL of my phpMyAdmin it updates the record so I know the code is fine. Im now using the same code for three different forms on three different tables and in each case, have the same problem. Will create a new record but will not update one.
Ive checked the permissions to ensure that the relevant login is allowed to update and it is (I even created a whole new user and changed the details to that, but nothing).
Has anyone got any thoughts?
Heres my code.
Code:
$thequery="INSERT INTO news VALUES('','$heading','$link','$blurb','$nowtime','$datekill')";
if ($hideid) {
$thequery="UPDATE news SET heading = '$heading',link = '$link', blurb = '$blurb' WHERE id = $hideid";
}
$result = $connector->query($thequery);
echo $thequery;
Which is linked to a simple form for adding/ updating news items. When adding a new item it works a treat, no problems.
When amending an item, nothing happens. I dont get an error message and the echo produces:
Code:
UPDATE news SET heading = 'testheading',link = 'testlink', blurb = 'test the blurb here' WHERE id = 43
Record 43 definitely exists (its the one I just successfully added).
If I copy the echo above and paste it directly into the SQL of my phpMyAdmin it updates the record so I know the code is fine. Im now using the same code for three different forms on three different tables and in each case, have the same problem. Will create a new record but will not update one.
Ive checked the permissions to ensure that the relevant login is allowed to update and it is (I even created a whole new user and changed the details to that, but nothing).
Has anyone got any thoughts?