Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Bidding Directory   Perfect Money   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 10-17-2004, 06:05 PM   #1 (permalink)
Moderator
 
South's Avatar
 
Join Date: 10-13-03
Location: Statesboro, Georgia
Posts: 3,064
iTrader: 0 / 0%
South is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest order
php help

This goes with an automobile dealer script to add featured listings on the front page. As it is it lists all featured vehicles one over the other in a verticle row. What I want to do is have it list horizonally and be able to define how many before a new row is started (make sense)? In other words, three across, then start a new row.

Thanks in advance.

<?php
//EXAMPLE CODE:

//handles the listing of featured properties
$result = mysql_query("SELECT * FROM vehicles WHERE featured = 'Y';",$link);
while ($a_row =mysql_fetch_array ($result) )
{
//add commas to price
$a_row[price] = number_format ($a_row[price]);

print "<P>";
print "<a href=\"./carview.php?view=$a_row[id]\"><b>$a_row[title]</b></a><BR>";
//select images connected to a given listing
$query = "SELECT * FROM tbl_Files WHERE prop_num = $a_row[id] LIMIT 1";
$output = mysql_query("$query",$link);


$count = 0;
while ($image_row =mysql_fetch_array ($output) )
{


print "<a href=\"carview.php?view=$a_row[id]\"><img src='image.php?Id=$image_row[id_files]' border=1 width=100 alt=\"Photo\"></a><br>";
$count++;
}


if ($count == 0)
{
print "<a href=\"./carview.php?view=$a_row[id]\"><img src=\"./images/nophoto.gif\" border=1 width=100 alt=\"View Listing\"></a><br>";
}


print "$a_row[year] $a_row[model] $a_row[make]<BR>";
print "\$$a_row[price]<BR>";
print "<P>";



}
//END OF EXAMPLE
?>
__________________
"The powers not delegated to the United States by the Constitution, nor prohibited by it to the States, are reserved to the States respectively, or to the people."
South is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 10-17-2004, 07:05 PM   #2 (permalink)
Contributing Member
 
Pimpen 2010's Avatar
 
Join Date: 10-13-03
Location: Pffffft
Posts: 8,857
iTrader: 0 / 0%
Latest Blog:
None

Pimpen 2010 is just really nicePimpen 2010 is just really nicePimpen 2010 is just really nicePimpen 2010 is just really nicePimpen 2010 is just really nicePimpen 2010 is just really nicePimpen 2010 is just really nicePimpen 2010 is just really nicePimpen 2010 is just really nicePimpen 2010 is just really nicePimpen 2010 is just really nice
Send a message via AIM to Pimpen 2010 Send a message via Yahoo to Pimpen 2010
You might have to change that in phpMyAdmin, but I don't know much PHP, so don't trust me on this
__________________
Hummer Forums
Trick It Out
Pimpen 2010 is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-17-2004, 07:43 PM   #3 (permalink)
Moderator
 
South's Avatar
 
Join Date: 10-13-03
Location: Statesboro, Georgia
Posts: 3,064
iTrader: 0 / 0%
South is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest order
Quote:
Originally Posted by Pimpen 2010
You might have to change that in phpMyAdmin
I hope not or I'm pretty much screwed.
__________________
"The powers not delegated to the United States by the Constitution, nor prohibited by it to the States, are reserved to the States respectively, or to the people."
South is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-17-2004, 07:55 PM   #4 (permalink)
v7n Mentor
 
hatchet's Avatar
 
Join Date: 10-11-03
Posts: 1,137
iTrader: 0 / 0%
Latest Blog:
None

hatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nice
http://codewalkers.com/tutorials.php?show=15
hatchet is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-17-2004, 08:19 PM   #5 (permalink)
Moderator
 
South's Avatar
 
Join Date: 10-13-03
Location: Statesboro, Georgia
Posts: 3,064
iTrader: 0 / 0%
South is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest orderSouth is a web professional of the highest order
Thanks Hatchet, I really need to go through some more tutorials before using this so I don't screw up the rest of the site.

"I am going to make a couple assumptions during this tutorial. First, that you already understand how to query your data out of the database. Second, that you understand the basics of PHP" scares me.

I've started a new thing where I really have to turn these things out fast for awhile so I can't afford to get bogged down screwing up the database and having to start over.

My current project is going to take quite a while, but when I get caught up I'm finally going to sit down and spend some time studying PHP so I'm not so needy all the time.
__________________
"The powers not delegated to the United States by the Constitution, nor prohibited by it to the States, are reserved to the States respectively, or to the people."
South is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 01:19 AM.
© Copyright 2008 V7 Inc