Jump to content

mysql UPDATE request not working and driving me crazy!!!


spenceddd

Recommended Posts

Hi,

 

I have been stuck on this for ages.

 

Quite simply I am trying to update my database with an update command:

 

$query="UPDATE `spence13_Portfolio`.`skillsList` SET `skillName` = '$newSkillName' WHERE `skillsList`.`ID` =$id";

 

This doesn't work even though if I change the line to read:

 

$query="UPDATE `spence13_Portfolio`.`skillsList` SET `skillName` = '$newSkillName' WHERE `skillsList`.`ID` =7";

 

..then it does work. The variable $id does equal a number and I even use this code to convert it to an integer just incase it's read as a string:

 

$id = $_POST[skillsListDropDown]; //this is say 7
$id = ((int)$id);

 

Can anyone please help me.

 

Thanks

 

Spencer

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.