Re: eof bof in php

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

 



Thanks Ashley ... I have been trying that but I think my syntax id shot!!

<?php
if ($totalRows_rsSearch="0")
echo "Sorry no products were found";
else
echo "<h3>Please click on a product for further information.</h3>"
?>
 <!-- Product block start search results -->
     <?php do { ?>
<div class="productitem"><img src="products<?php echo $row_rsSearch['product_image']; ?>" />
       <div class="text">
         <h3><?php echo $row_rsSearch['product_name']; ?></h3>
<p class="style1"><?php echo $row_rsSearch['product_subtitle']; ?></p> <a href="products<?php echo $row_rsSearch['product_url']; ?>">View Product</a>
         <div class="clear"></div>
         </div> <div class="clear"></div>
      <center>
         </center>
       </div>
 <?php } while ($row_rsSearch = mysql_fetch_assoc($rsSearch)); ?>

--
- Gary Maddock-Greene
"Ashley Sheridan" <ash@xxxxxxxxxxxxxxxxxxxx> wrote in message news:1229873521.4229.6.camel@xxxxxxxxxxxxxxxxxxxxxxxx
On Sun, 2008-12-21 at 15:22 +0000, Gary Maddock-Greene wrote:
Hi, I'm very new to php. Please can someone point me in the right direction?
I want to display a message: 'No Products Found' if my search record set
returns no value.

I think I need to be looking at this section of my code ...

$query_rsSearch = sprintf("SELECT * FROM products WHERE product_name LIKE
%s", GetSQLValueString("%" . $colname_rsSearch . "%", "text"));
$rsSearch = mysql_query($query_rsSearch, $sondia_lighting) or
die(mysql_error());
$row_rsSearch = mysql_fetch_assoc($rsSearch);
$totalRows_rsSearch = mysql_num_rows($rsSearch);
?>

Thanks

- Gary Maddock-Greene


Can you not just use the $totalRows_rsSearch value inside of an if
statement?


Ash
www.ashleysheridan.co.uk



--
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