sql insert problem with columns named one,two,three

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   sql insert problem with columns named one,two,three
floppydrivez
CZ Addict
 Codezwiz Site Donator
floppydrivez has been a member for over 18 year's 18 Year Member
usa.gif mississippi.gif
Occupation: graphic design
Age: 43
Gender: Male
Website:
Status: Offline
Joined: Feb 26, 2006
0.08 posts per day
Posts: 518
Points: 4,848
AIM Address Yahoo Messenger MSN Messenger 
This is a strange question.

I have an insert and the columns are name one, two, and three.

It will not go, but if I just use "the one column" it works. Is there any reason for this?


$rid = intval($rid);
$rtitle = strip_tags($rtitle);
$one = strip_tags($one);
$two = strip_tags($two);
$three = strip_tags($three);
$sql = "INSERT INTO ".$prefix."_server_rules (`rid`,`rpos`,`rtitle`,`rdetails`,`one`,'two','three') VALUES ('NULL','NULL','$rtitle','$rdetails','$one','$two','$three')";
$db->sql_query($sql) or die ('Could not insert into table');


Anyone see anything wrong?


Back to top Reply with quote
#2   re: sql insert problem with columns named one,two,three
floppydrivez
CZ Addict
 Codezwiz Site Donator
floppydrivez has been a member for over 18 year's 18 Year Member
usa.gif mississippi.gif
Occupation: graphic design
Age: 43
Gender: Male
Website:
Status: Offline
Joined: Feb 26, 2006
0.08 posts per day
Posts: 518
Points: 4,848
AIM Address Yahoo Messenger MSN Messenger 
I figured this out.

In the above case my one two and three fields where inside the loop. Therefor it was only returning one of those values.



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum