Jump to content

I have a question


j007ha

Recommended Posts

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 :P

Link to comment
Share on other sites

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 :D 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.