elricstorm
05-30-2007, 01:23 PM
Okay, I'm probably brain saturated because I've been up for a long long time but I'm having problems with a sql query:
$info_insert = "REPLACE INTO ".TABLE_PREFIX."wowraid (userid,m_name,m_class,m_race,m_level) VALUES (".$vbulletin->userinfo['userid'].",".$mycharacter.",".$field6.",".$field7.",".$field8.")";
$db->query_write($info_insert);
I get the following:
Invalid SQL:
REPLACE INTO wowraid (userid,m_name,m_class,m_race,m_level) VALUES (3,Drabin,Mage,Human,70);
MySQL Error : Unknown column 'Drabin' in 'field list'
Error Number : 1054
Drabin is the value for m_name corresponding to the variable $mycharacter. What am I doing wrong? It's probably something simple and I'm just missing it. Thanks in advance.
I fixed it - I was missing ticks -
ex.
'".$variable"','".$variable2."',etc.
$info_insert = "REPLACE INTO ".TABLE_PREFIX."wowraid (userid,m_name,m_class,m_race,m_level) VALUES (".$vbulletin->userinfo['userid'].",".$mycharacter.",".$field6.",".$field7.",".$field8.")";
$db->query_write($info_insert);
I get the following:
Invalid SQL:
REPLACE INTO wowraid (userid,m_name,m_class,m_race,m_level) VALUES (3,Drabin,Mage,Human,70);
MySQL Error : Unknown column 'Drabin' in 'field list'
Error Number : 1054
Drabin is the value for m_name corresponding to the variable $mycharacter. What am I doing wrong? It's probably something simple and I'm just missing it. Thanks in advance.
I fixed it - I was missing ticks -
ex.
'".$variable"','".$variable2."',etc.