Jump to content

Adding count in include file


petenaylor

Recommended Posts

Hi all

 

I have a string in an include file for a javascript lightbox value. I need this value to increase by one every time it loops. Here's my code:

 

$fetchproducts = mysql_query(" SELECT * FROM `products` ");

  while($returnedProduct = mysql_fetch_array($fetchproducts)) {

 

include('product-cell.php');

 

}

 

The string is called $lightboxcount in the product-cell.php file

 

Can I fit a ++ into the code above?

 

Many thanks for your help

 

Pete

Link to comment
https://forums.phpfreaks.com/topic/221874-adding-count-in-include-file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.