Site Cloner PHP Script
Bargain Hunter PHP Script
Job Hunter PHP Script
Site Login and Access Control PHP Script

PHP Array To A Table

$query = “SELECT * FROM table1, table2 WHERE table1.artist_id = table2.artist_id ORDER BY table1.last_name ASC”;

echo ‘<div style=”text-align:center; margin-left:15%;margin-right:15%;”><table border=”0″ width=”400px” cellspacing=”3″ cellpadding=”3″ align=”center” >
<td align=”left” width=”20%”><b>Artist</b></td>
<td align=”left” width=”20%”><b>product Name</b></td>
<td align=”left” width=”20%”><b>Description</b></td>
<td align=”left” width=”30%”><b>Image Name</b></td>
<td align=”right” width=”10%”><b>Price</b></td>

// Display all the URLs.
$result = mysqli_query ($db, $query);
while ($row = mysqli_fetch_assoc ($result)) {

// Display each record.
echo ”    <tr>
<td align=\”left\”><a href=\”browse_products.php?aid={$row[‘artist_id’]}\”>{$row[‘last_name’]}, {$row[‘first_name’]} </a></td>
<td align=\”left\”><a href=\”view_product.php?pid={$row[‘product_id’]}\”>{$row[‘product_name’]}</td>
<td align=\”left\”>” . stripslashes($row[‘description’]) . “</td>”;?>
<td align=”left”><? echo “<a href=\”view_product.php?pid={$row[‘product_id’]}\”>”; ?> <img src=”admin/myuploads/<? echo stripslashes($row[‘image_name’]); ?> “/></a></td>
<? echo ” <td align=\”right\”>\${$row[‘price’]}</td>

} // End the while loop.

echo ‘</table></div>’; // Closing the table.