Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host="localhost";
- $username="carinfo_admin";
- $password="mypwrod";
- $database="carinfo_listings";
- $conn = mysql_connect($host,$username,$password) or die(mysql_error());;
- $query = "SELECT `id`, `firstname`, `item`, `price`, `city`, `desc`, `email`, `phone` FROM listings LIMIT 10";
- $listings = '';
- if($result = mysql_query($query)){
- if(mysql_num_rows($result)){
- while($row=mysql_fetch_assoc($result)){
- $listings.="
- <div class=\"addText\"><a href=\"#\"><em><strong>{$row['item']} - Part #{$row['id']}</strong></em></a>
- <p>{$row['desc']}</p>
- <p><span>Contact:</span> <a href=\"mailto:email\">{$row['firstname']} - {$row['phone']}</a><br />
- <span>Part Type: </span>{$row['item']}</p>
- </div>";//endlistings
- }//whileres
- }//ifrows
- }//ifquery
- ?>
- Then below I echo the listings variable:
- <?php echo $listings;?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement