Jump to content
Larry Ullman's Book Forums

Recommended Posts

It is a fairly basic table as per the other tables in your book. It is containing:

discount_id: int(11)

discount_code: varchar(25)

discount_amount

 

I just selected select all from table so I was not missing something.

 

I am unsure how to script the voucher discount to read the discount entered by the customer in the form.

Link to comment
Share on other sites

This is a bit confusing. What is the tablename? Your select statement should be in the format of

SELECT columnname FROM tablename WHERE columnname = '$variable' 

Assuming your table is named discount_codes and the column is named vouchercode...

SELECT discount_amount FROM discount_codes WHERE vouchercode = '$vouchercode'

Run your mysql statements in something like phpmyadmin and if it doesn't work it will give you a message to indicate where the error is. Then in your posts you can be more specific rather than just stating it doesn't work, which doesn't actually give any information.

 

I would recommend reading chap 5 and chap 8.

Link to comment
Share on other sites

 Share

×
×
  • Create New...