Jump to content

Adding to a database


craigtolputt

Recommended Posts

Hi Guys,

 

I have a flash website which has a registration form so that users can register and then login to a different area of the site.

All this is fine and the data gets stored in a mysql database.

 

it stores the following...

 

username

password

name

surname

email

telephone

address

town

county

postcode

 

Now what i need to do is add another form inside the user section for them to be able to register a product code and details against their username.

 

The details that i need to update the database with are...

 

Canister Number

Installer Address Details

Name

Surname

Full address and postcode

Telephone

Location of product

 

But these details need to be tied against their username and they need to be able to add more than one.

 

It needs to be linked to the username as when they login again they can review all the products they have registered.

 

Does anyone know how this would be done or if you need to see the registration php files first to understand what i have already just say.

 

cheers

 

Craig

Link to comment
https://forums.phpfreaks.com/topic/116230-adding-to-a-database/
Share on other sites

Cool thanks for the quick reply....

 

I should just add at this stage that im a flash design and bought the registration php and flash from flashden.net so im a newbie to say the least.

 

So in my users table Create a column called 'id' and make it -> primary key, auto increment. thats already in there....

 

Create a colum in the products page called 'user_id'.. when you insert a new product, throw the user's id that added it into that column. Problem solved!

 

this part im stuck on sorry, should i create a new table called something like products and then add the fields like

 

id

Canister Number

Installer Address Details

Name

Surname

Full address and postcode

Telephone

Location of product

 

then from flash send these details and the id will automatically know what users it is????

 

???

Link to comment
https://forums.phpfreaks.com/topic/116230-adding-to-a-database/#findComment-597646
Share on other sites

Ok i now have this form here which is the same as my registration form but i have changed and added some other fields

 

http://www.tktest.co.uk/redweb/newscms

 

and i have it saving the data into my DB.

 

now is there a way that i can link this table in my db with the users table in the db to that i can load the data from this table against the correct user?

 

Man this is complicated, but atleast im learning lol...

 

also once someone has added one product they can add another but i need it to add to their previous products if that makes sense?

 

am i doing this the right way round or is there an easier way?

 

cheers

 

Craig

Link to comment
https://forums.phpfreaks.com/topic/116230-adding-to-a-database/#findComment-598364
Share on other sites

These are the fields in myDB

 

id int(11) auto_increment             

username varchar(32)               

dna_no varchar(32)               

firstName varchar(32)               

lastName varchar(32)               

email varchar(50)               

phone varchar(32)               

address varchar(60)               

city varchar(32)               

county varchar(32)               

postcode varchar(32)               

product varchar(32)               

confKey varchar(32)

Link to comment
https://forums.phpfreaks.com/topic/116230-adding-to-a-database/#findComment-598366
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.