Jump to content

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


stevengreen22

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!

 

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.