j007ha Posted July 14, 2008 Share Posted July 14, 2008 Hi all, I have a question about how to adding a new row in a table after a row of record have been enter. Example: Im using a drop down list to let user to select a list of item and after the user have make their choose all information about the item will be fill into the row of the table. So in this case, if the user wish to select one or more item, then how can i adding a new row for the purpose of storing the information of the item? This is my 1st post hehe hope can receive any one of ur reply Quote Link to comment Share on other sites More sharing options...
Dethman Posted July 14, 2008 Share Posted July 14, 2008 ALTER TABLE `tablename` ADD rowname int(255) <<Depending on type>> NOT NULL << depening on null type >> DEFEAULT '0' Should look like this ALTER TABLE `tablename` ADD rowname int(255) NOT NULL DEFAULT '0' Hope this helps Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 14, 2008 Share Posted July 14, 2008 You should have additinoal tables and not grow a table sideways. Example Users table UserID Password etc. Items Table ItemID Description etc. Users_Items UserID, ItemID The Users_Items list all the "items" a specific user has. You can do anything from 0-infinity items per user/ add items etc. 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.