ulenie Posted July 21, 2006 Share Posted July 21, 2006 The current code is$sql = 'INSERT INTO stats (subid,ref) VALUES (\''.$_POST['email'].'\',\''.$_REQUEST['ref'].'\')';What i want to do is insert a "name" and "paid" column. And I want to set name to 'Registration Bonus' and paid to '1.00'. The table and everything is already created. Someone help me please! Link to comment https://forums.phpfreaks.com/topic/15209-help-with-a-simple-code/ Share on other sites More sharing options...
hvle Posted July 21, 2006 Share Posted July 21, 2006 first of all, I suggested you should revise the query for viewing friendly. After all, you're human.So what u wanted is along with inserting subid, ref, you'd like to insert name and paid with it.here is the code:[code]$sql = "insert into stats (subid,ref,name,paid) values ('{$_POST['email']}', '{$_REQUEST['ref']}', 'Registration Bonus', '1.00')";[/code] Link to comment https://forums.phpfreaks.com/topic/15209-help-with-a-simple-code/#findComment-61458 Share on other sites More sharing options...
ulenie Posted July 21, 2006 Author Share Posted July 21, 2006 [quote author=hvle link=topic=101323.msg400935#msg400935 date=1153446870]first of all, I suggested you should revise the query for viewing friendly. After all, you're human.So what u wanted is along with inserting subid, ref, you'd like to insert name and paid with it.here is the code:[code]$sql = "insert into stats (subid,ref,name,paid) values ('{$_POST['email']}', '{$_REQUEST['ref']}', 'Registration Bonus', '1.00')";[/code][/quote]Sorry, I didn't write the code. When I looked at it, i thought the same thing. That's why i couldnt figure it out. I tried to do similar to what you wrote but it gave me an error. Let me try exatly what you wrote. Thanks. Link to comment https://forums.phpfreaks.com/topic/15209-help-with-a-simple-code/#findComment-61462 Share on other sites More sharing options...
hvle Posted July 21, 2006 Share Posted July 21, 2006 If you received error, post the whole error message. Link to comment https://forums.phpfreaks.com/topic/15209-help-with-a-simple-code/#findComment-61464 Share on other sites More sharing options...
ulenie Posted July 21, 2006 Author Share Posted July 21, 2006 [quote author=hvle link=topic=101323.msg400942#msg400942 date=1153448533]If you received error, post the whole error message.[/quote]It worked perfectly and was very easy to understand. Thanks much. Link to comment https://forums.phpfreaks.com/topic/15209-help-with-a-simple-code/#findComment-61466 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.