Wednesday, 15 April 2015

mysql - SQL select WHERE AND AND -


I have a product page and when you click Add to Cart

  $ Pid = $ _POST ['PID']; $ Size = $ _POST ["length"]; $ Range = $ _POST ['category'];   

It runs a POST method, which can be selected based on the length of the post that posts the above. Because the category is a drop down menu ... I am posting the selected sections to the user.

Examples of my 3 tables and queries are given below Hope the table helps: Product

  Pid name 1 man 2 female 3 children  < / Pre> 

Table: Category

  CatID name PD1 pen 1 2 pen 1 3 pencil 2 3 red_pen 3 table active_product  
  ATPID size PID Cost of 1 12 1 10 2 14 2 15 3 16 3 20 4 18 4 30 I have tried my query  
  SELECT name , Size, activation product, product, category WHERE Product.pid = 1 and come Doors ='m 10 and Namksreni = pen range is not working query 1   

I can it improve?

I think you should:

  SELECT products Product name by name, size, activation, product WHERE Product.pid = 1 and size = 10 and category. Name = "pen" range 1   

The name is not the table.

No comments:

Post a Comment