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


Posted on 16th Feb 2014 07:03 pm by admin

Hi,

I have been stuck on this for ages.

Did you know?Explore Trending and Topic pages for more stories like this.
Quite simply I am trying to update my database with an update command:

Code: $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:

Code: $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:

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

Can anyone please help me.

Thanks
No comments posted yet

Your Answer:

Login to answer
199 Like 35 Dislike
Previous forums Next forums
Other forums

Scrolling news bar and MySQL
I am not sure if this is the correct forum to post this on. If not, I apologize. I am still pretty

Save cookie to DB
I'm working on a pixel tracking script for an incentive website and I need to use an ASP script to s

Storing Values taken from a DB...
Using this code it will generate a short list from my database

<?php
mysql_connect

Automatic Webpage ??
I have a page www.mysite.com/test.php with a
<form>
<textarea name=&q

Two warning messages
Quote<b>Warning</b>: mysql_real_escape_string() expects parameter 1 to

help with contest script
I would like to code a contest script to my site but i don't know how. Could someone just give me pu

Odd or Even
Inside of a while loop I need to echo several rows of info...easy enough.

In the loop (for th

insert quotes
Hi,

I have an output like this:
Code: john,18,Cancer
How can I change this to
Code:

Uploading files/images via forms
Hey all, I am building a database for work that will contain some minor data on plant species along

pageination not working right... coping images over 4 pages
Code: <?php //This code will obtain the required page number from the $_GET array. Note that

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash