RAH Posted September 25, 2007 Share Posted September 25, 2007 Hello, The id collumn is setup for auto increment however how do I modify the following code to achieve this? insert into vhc_items (id, cid, name, time, pic, description, link, hidden, filter, clicks, weekclicks, clickslog, pin, starttime, endtime) values ('9999999', '1', '".addslashes($title)."', '1189875417','" . addslashes($md5) . ".png', '" . addslashes($descr) . "' ,'" . addslashes($md5) . ".flv','0', '0', '0', '0', '4|0|0|0|0|0|0|1189983109', '0', '0', '0') Thanks. Quote Link to comment Share on other sites More sharing options...
Barand Posted September 25, 2007 Share Posted September 25, 2007 Either omit id from the columns and 999999 from the values, or write NULL to te id column INSERT INTO table (id, col1) VALUES (NULL, 'someval') or INSERT INTO table (col1) VALUES ('someval') Quote Link to comment Share on other sites More sharing options...
RAH Posted September 25, 2007 Author Share Posted September 25, 2007 Hello, Yes, I originally removed the ID column and value from the insert statement however by doing this or NULL I get this error: Duplicate entry '2147483647' for key 1 Quote Link to comment Share on other sites More sharing options...
Barand Posted September 25, 2007 Share Posted September 25, 2007 Specify the id field as unsigned so you can hold more than 2,147,483,647 rows. Quote Link to comment Share on other sites More sharing options...
RAH Posted September 25, 2007 Author Share Posted September 25, 2007 Hello, How do I specify it as unsigned? Thanks. Quote Link to comment Share on other sites More sharing options...
Barand Posted September 25, 2007 Share Posted September 25, 2007 http://dev.mysql.com/doc/refman/4.1/en/alter-table.html Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.