Jump to content

Archived

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

stevengreen22

Help with both Inserting tables and using a servet to run the queries

Recommended Posts

Hi guys,

 

I'm hoping someone may be able to help and that the lack of PHP in the topic wont be a deterrant.

 

I've a task that involves creating a website that imitates an online shop.

 

Theres a database involved with relevant info for obtaining the details.

 

So far, I've got the site up and running using both html pages and servlets.  I can run queries to the db using the servlet and postgres and can also display the info on another screen.

 

What I'd like to do is firstly find out the correct method for inserting the information gathered such as card details etc into the db and also how I can use this to reflect stock levels?  I'm thinking that as soon as something is bought I must have to 'delete' that item from the stock while inserting the item and card details etc into 2 new tables (payments and cust info)

 

Could anyone help please?

 

Also...I'm searching for a way to validate the information given.  I'd like to restrict the text field for contact numbers to nothing but numbers.  And also for the card lenght, must be 16 digits etc.

 

For card length I cna see the logic fairly clearly in that : if (cardLength > 16){print error etc}else{return} (I think this is structured incorrectly but I hope the logic is partially right.

 

Many thanks for your time and help!

 

Share this post


Link to post
Share on other sites

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