Re: MySQL Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



$num_items = amount user wants;
$td2 = floor($num_items/2);
$td1 = $num_items-$td2;

print("<td>");
for($i = 0; $i < $td1; $i++) {
    print(....);
}
print("</td>");
print("<td>");
for($i = $td1; $i < $td2; $i++) {
   print(....);
}
print("</td>");



.bobo



----- Original Message ----- 
From: "Dean Hayes" <wizard_guy@hotmail.com>
To: <php-windows@lists.php.net>
Sent: Thursday, September 25, 2003 5:58 AM
Subject:  MySQL Help


>
> Hey,
>
> I am working on a new script that allow's the use to insert upto 10 extra
> image per item in the catalog. What i need to do is print 5 images per
line.
>   I need to know how i can print 5 image per <td> field the code i
currently
> have is this
>
> $num_items = amount user wants;
> $num = $num_items / 2;
>
> if ($num_items == "10") {
> for ($i=0;$i<$num;$i++) {
>
> echo "<img src="$img_name" size="100" width="100"><br>Click Image To See
> Preview";
>
> }
>
> for ($i=5;$i<$num_items;$i++) {
>
> echo "<img src="$img_name" size="100" width="100"><br>Click Image To See
> Preview";
>
> }
>
> }
>
> as you see this is really only good if there is 10 images but some
products
> have 3 some have 7 is there a way i can do this so it always put's the
same
> amount of images per line when the number is over 5
>
> thanks
>
> Dean "The Insane Guy" Hayes
> Mystical Web Designs
> http://www.mystical-sector.com
>
> <-- I design and i redesign but still i never designed true beauty like
you
> -->
>
> _________________________________________________________________
> Hot chart ringtones and polyphonics. Go to
> http://ninemsn.com.au/mobilemania/default.asp
>
>
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux