What am i missing in this MySQL statement?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

vincenzobar
Forum Commoner
Posts: 95
Joined: Wed Nov 02, 2005 9:57 am

Post by vincenzobar »

CB_rateplan is 28 columns

archive_rateplan is 29

achive has its own ar_id and then the next column is the CB_rateplan table R_id -28 total rows = 29

is this a problem? i thought Auto increment didn't need a value in an insert statement
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

it needs you to submit this -> '' just a blank value
vincenzobar
Forum Commoner
Posts: 95
Joined: Wed Nov 02, 2005 9:57 am

Post by vincenzobar »

how in the hell do i do that!!!! ;)
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

VALUES ('1', 'Greater Freedom 700 - 2YR', '700', '39.9900', '0.4000', '20.0000', '0.9900', 'up to $.99/min', '24', '$200.00', '', '', '1000', '', '1000', '', '0', '$0.00/min within home calling area ($0.25/min outside home calling area)', '', '', '', '', '53037', 'alltel wireless', 'images/carriers/', 'alltel_logo.gif', 'false', '13283')
OK... in those values, you still need to have a field for the id... just make it blank. If the id is your first column, just make that into this...
VALUES ('', '1', 'Greater Freedom 700 - 2YR', '700', '39.9900', '0.4000', '20.0000', '0.9900', 'up to $.99/min', '24', '$200.00', '', '', '1000', '', '1000', '', '0', '$0.00/min within home calling area ($0.25/min outside home calling area)', '', '', '', '', '53037', 'alltel wireless', 'images/carriers/', 'alltel_logo.gif', 'false', '13283')
vincenzobar
Forum Commoner
Posts: 95
Joined: Wed Nov 02, 2005 9:57 am

Post by vincenzobar »

i did..

Code: Select all

$db_row = mysql_fetch_row($all_rows);
	$move[] = "'', "."'".implode("', '", $db_row)."'";
and i got this
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'archive_rateplan VALUES ('', '1', 'Greater Freedom 700 - 2YR', '700', '39.9900'' at line 1
vincenzobar
Forum Commoner
Posts: 95
Joined: Wed Nov 02, 2005 9:57 am

Post by vincenzobar »

nevermind dumb mistake!!!

It worked!!! thanks

i forgot i put acolumn call in and once i deleted that it worked great!!!
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

YAY!!
conthox
Forum Commoner
Posts: 39
Joined: Tue Jun 25, 2002 1:44 pm
Location: Sweden

Post by conthox »

Image
Last edited by conthox on Mon Nov 28, 2005 11:43 am, edited 1 time in total.
vincenzobar
Forum Commoner
Posts: 95
Joined: Wed Nov 02, 2005 9:57 am

Post by vincenzobar »

laughing my ass off!!!!
Post Reply