Still getting #1064s!!!?!!?!!
Still getting #1064s!!!?!!?!!
am 10.12.2006 03:17:48 von Mwahahahahaaahaa
Hello all... I'm always getting these 1064 errors... For example I have
a mySQL dbase that i can connect to fine.. read values etc fine.. but I
want to update a field with different text and it won't work.. I've
tried numerous variations, but here is one of them.
p.s. the vars are as follows:
$globalYear = "2006";
$dayAsWord = "twentythree";
$updatedText = "What I want to insert";
$globalMonth = "dek" // I had "dec" but that was a reserved word so i
changed it.
$theQuery = "UPDATE '{$globalYear}' SET '{$dayAsWord}' =
'{$updatedText}' WHERE 'months' LIKE '{$globalMonth}'";
My table is as Follows:
month | start | days | one | two | etc....
___________________________________
dek | 3 | 31 | | |
If anyone can point me in the right direction on how to avoid the
#1064 errors I would greatly appreciate it!!!!!!!!!!!!!!!!!!!!!! I've
tried removing ' away from certain words and adding to others and no
combination has helped at all... this language is EASY except for this
part, which I don't understand..... Thanks again ahead of time!!!!
Re: Still getting #1064s!!!?!!?!!
am 10.12.2006 04:34:49 von Mwahahahahaaahaa
BTW.. I also tried:
$theQuery = "UPDATE '{$globalYear}' SET '{$dayAsWord}' =
'{$updatedText}' WHERE 'month' = '{$globalMonth}'";
which ECHO'd:
UPDATE '2006' SET 'one' = 'dddd' WHERE 'month' = 'dek'
Don't know what is wrong.. 2006 is my table. "one" is an accurate
field. so is "month" and so is the value "dek". I also tried changing
'month' to 'months' to see if it was a used keyword, but it didn't
change the results
Re: Still getting #1064s!!!?!!?!!
am 10.12.2006 07:19:51 von Shion
Mwahahahahaaahaa wrote:
> Hello all... I'm always getting these 1064 errors... For example I have
> a mySQL dbase that i can connect to fine.. read values etc fine.. but I
> want to update a field with different text and it won't work.. I've
> tried numerous variations, but here is one of them.
>
> $theQuery = "UPDATE '{$globalYear}' SET '{$dayAsWord}' =
> '{$updatedText}' WHERE 'months' LIKE '{$globalMonth}'";
$theQuery = "UPDATE `{$globalYear}` SET `{$dayAsWord}` =
'{$updatedText}' WHERE `months` LIKE '{$globalMonth}'";
Do you see the difference?
//Aho
Re: Still getting #1064s!!!?!!?!!
am 10.12.2006 07:28:05 von Mwahahahahaaahaa
It worked! I don't see any difference thought?! What was the error?
Thanks so much!
> > $theQuery = "UPDATE '{$globalYear}' SET '{$dayAsWord}' =
> > '{$updatedText}' WHERE 'months' LIKE '{$globalMonth}'";
>
> $theQuery = "UPDATE `{$globalYear}` SET `{$dayAsWord}` =
> '{$updatedText}' WHERE `months` LIKE '{$globalMonth}'";
>
> Do you see the difference?
>
>
> //Aho
Re: Still getting #1064s!!!?!!?!!
am 10.12.2006 09:49:15 von Shion
Mwahahahahaaahaa wrote:
> It worked! I don't see any difference thought?! What was the error?
> Thanks so much!
>
>>> $theQuery = "UPDATE '{$globalYear}' SET '{$dayAsWord}' =
>>> '{$updatedText}' WHERE 'months' LIKE '{$globalMonth}'";
>> $theQuery = "UPDATE `{$globalYear}` SET `{$dayAsWord}` =
>> '{$updatedText}' WHERE `months` LIKE '{$globalMonth}'";
>>
>> Do you see the difference?
You use `` around column names and '' around values.
//Aho
Re: Still getting #1064s!!!?!!?!!
am 10.12.2006 23:39:50 von Mwahahahahaaahaa
> You use `` around column names and '' around values.
I see!!! LOL, those barely look different! Now I know where half of my
problems are coming from. Thanks again Aho, for all your help!