Jump to content

jlommori

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jlommori's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm new to using PHP to display mySQL results... I'm trying to display specific items from the DB into a table. The user will fill out a form on the previous page, then the results are sent to the current page via the "POST" method. The problem is, PHP is only display 1 result from the DB, not all the records that it should... here is the code: Within the <head> tag: <?php require_once('../Connections/Products.php'); ?> <?php mysql_select_db($database_Products, $Products); $query_Recordset1 = "SELECT * FROM PRODUCT_PAGES WHERE keyword_color = '$_GET[color]' "; $Recordset1 = mysql_query($query_Recordset1, $Products) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> Within the <body> tag: <?php echo "<table border='1'> <tr> <th>name</th> <th>desc</th> <th>price</th> <th>related1</th> <th>related2</th> <th>related3</th> </tr>"; $name = $row_Recordset1['PDCT_NAME']; $desc = $row_Recordset1['PDCT_DES']; $price = $row_Recordset1['PDCT_PRICE']; $related1 = $row_Recordset1['RELATED1']; $related2 = $row_Recordset1['RELATED2']; $related3 = $row_Recordset1['RELATED3']; echo "<tr>     <td>$name</td> <td>$desc</td> <td>$price</td> <td>$related1</td> <td>$related2</td> <td>$related3</td> </tr>"; ?> Any suggestions are greatly appreciated!!!!
×
×
  • 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.