petenaylor Posted December 16, 2010 Share Posted December 16, 2010 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 Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted December 16, 2010 Share Posted December 16, 2010 Can I fit a ++ into the code above? yes. Quote Link to comment Share on other sites More sharing options...
petenaylor Posted December 16, 2010 Author Share Posted December 16, 2010 Cheers! Can you show me how? Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted December 16, 2010 Share Posted December 16, 2010 $rec_count = 0; while($returnedProduct = mysql_fetch_array($fetchproducts)) { $rec_count++; // etc.... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.