How to implement an openid in PHP?

Whats wrong with the code and how to implement change?

  • I have a code linked up to my MySQL and it is already connected to the database, but I was wondering how it is possible to make sure only content shows from the field 'cat_platform' in the table 'product' when the text in cat_platform is 1. Here is the code so far: <?php $sql = mysql_query("SELECT * FROM product ORDER BY id DESC LIMIT 8"); while($row = mysql_fetch_array($sql)){ $products_id = $row['id']; $products_name = $row['name']; $products_price = $row['price']; $products_desc = $row['desc']; $products_stock = $row['stock']; $products_image = $row['image']; $cat_platform = $row['cat_platform']; ?> <br> <div id='category_list'><a href='/product.php?id=<?php echo $products_id; ?>'><?php echo $products_name; ?></a> <h4>Our Price:<?php echo $products_price; ?></h4> <img src='/images/products/<?php echo $products_image; ?>' width='85' height='65' /><br> <hr width='500px;' /></div> <?php } ?> Any help would be amazing

  • Answer:

    Add a WHERE clause to the query will allow you to only get specific results. This query will now only return records where the car_platform is 1. SELECT * FROM product WHERE cat_platform = 1 ORDER BY id DESC LIMIT 8 You need to replace this line $sql = mysql_query("SELECT * FROM product ORDER BY id DESC LIMIT 8"); with $sql = mysql_query("SELECT * FROM product WHERE cat_platform = 1 ORDER BY id DESC LIMIT ");

Liam at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

you can alter your select statement to only pull data from the database when cat_platform is 1 SELECT * FROM product WHERE cat_Platform = 1 ORDER BY id DESC LIMIT 8

Scott

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.