Hi,
I need some help that I just can't figure out. This should be easy, but I can't figure it out. I'm running PHP version 4.3.3 and MySQL version 4.0.18-standard.
This is basically an update statement and it works when I hardcode the following, it puts the string foo into GroupName at the specified GroupID.
$sql = 'UPDATE MainGroup SET GroupName = \'foo\' WHERE GroupID = '.$whichmod.' LIMIT 1 ;'
. ' ';
I have a string foo in variable $GroupName with the following query. I get the following error.
$sql = 'UPDATE MainGroup SET GroupName = '.$GroupName.' WHERE GroupID = '.$whichmod.' LIMIT 1 ;'
. ' ';
Unknown column 'foo' in 'field list'
Couldn't execute query: UPDATE MainGroup SET GroupName = '.foo.' WHERE GroupID = '.6.'
And this is another variation i've tried. with the following error.
$sql = 'UPDATE MainGroup SET GroupName = $GroupName WHERE GroupID = '.$whichmod.' LIMIT 1 ;'
. ' ';
Unknown column '$GroupName' in 'field list'
Couldn't execute query: UPDATE MainGroup SET GroupName = '.foo.' WHERE GroupID = '.6.'
I feel like i've tried every variation. I've just recently begun coding in php with mysql after a year or so layoff, so this feels like a problem I should have been able to figure out by know, but I haven't.
Any and all help would be appreciated.
thanks,
dan k.