Re: Only 4 of 5...

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

 



----- Original Message ----- From: "John Nichel" <jnichel@xxxxxxxxxx>
To: "PHP General" <php-general@xxxxxxxxxxxxx>
Sent: Friday, March 03, 2006 2:30 AM
Subject: Re:  Only 4 of 5...


Gustav Wiberg wrote:
Hi there!

What's wrong here??

<?php
...
open db...


$sql = "SELECT IDPic, picNameSmall FROM tbpics";

$querys = mysql_query($sql);
$dbArray = mysql_fetch_array($querys);

You're pulling the first row here

if (intval($frmIDModel)>0) {

?>
<b>Visa telefonbilder för <?php echo $dbModelName;?>:</b><br>
<?php
}
else if (intval($frmIDManufacturer)>0) {

   $dbNameManufacturer = $dbArray["nameManufacturer"];

 ?>
 <b>Visa telefonbilder för <?php echo $dbNameManufacturer;?>:</b><br>
 <?php
}
else {
?>
<b>Alla telefonbilder i arkivet:</b><br>
<?php


So now there are only 4 rows left when you loop thru them here.

   while ($dbArray = mysql_fetch_array($querys)) {
     $dbIDPic = $dbArray["IDPic"];
     $dbPicNameSmall = $dbArray["picNameSmall"];
     ?>
<img src="phonepics/<?php echo $idModel;?>_<?php echo $dbPicNameSmall;?>" alt="testbild från mobil" border="1" width="120" height="130">
     <?php

   }

}
   ?>

I have 5 posts in the table, but the images shown are only four! Why?

/G



--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Thanx, I got feedback on this one yesterday! :) Thanx anyway!

/G

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux