snwspeck Posted May 1, 2011 Share Posted May 1, 2011 Basically I am getting a warning saying: Warning: Invalid argument supplied for foreach() in /home/pybuyinf/public_html/store/ds-admin/generate_links.php on line 48 This is what is on Line 48: <?php foreach ($products as $product){ ?> Quote Link to comment https://forums.phpfreaks.com/topic/235253-foreach-error/ Share on other sites More sharing options...
requinix Posted May 1, 2011 Share Posted May 1, 2011 Then $products is not something you can foreach on. Might it be null? Quote Link to comment https://forums.phpfreaks.com/topic/235253-foreach-error/#findComment-1208928 Share on other sites More sharing options...
snwspeck Posted May 1, 2011 Author Share Posted May 1, 2011 The script I bought had it there, so it should be transferring the "products" array to "product" but is the "products" array not being called anywhere? Quote Link to comment https://forums.phpfreaks.com/topic/235253-foreach-error/#findComment-1208930 Share on other sites More sharing options...
fugix Posted May 1, 2011 Share Posted May 1, 2011 make sure that your $products var is an array Quote Link to comment https://forums.phpfreaks.com/topic/235253-foreach-error/#findComment-1208938 Share on other sites More sharing options...
snwspeck Posted May 1, 2011 Author Share Posted May 1, 2011 There is no array I believe on that script. I purchased this script a few moments ago and I am stuck with this error now... Quote Link to comment https://forums.phpfreaks.com/topic/235253-foreach-error/#findComment-1208940 Share on other sites More sharing options...
fugix Posted May 1, 2011 Share Posted May 1, 2011 well a foreach loop allows you to cycle through keys and values of an array...$products must be an array for the foreach loop to work Quote Link to comment https://forums.phpfreaks.com/topic/235253-foreach-error/#findComment-1208941 Share on other sites More sharing options...
snwspeck Posted May 1, 2011 Author Share Posted May 1, 2011 But shouldn't there be an include then with the array of $products? Quote Link to comment https://forums.phpfreaks.com/topic/235253-foreach-error/#findComment-1208945 Share on other sites More sharing options...
fugix Posted May 1, 2011 Share Posted May 1, 2011 im not sure...you would have to search the code for the var $products and see what it stores Quote Link to comment https://forums.phpfreaks.com/topic/235253-foreach-error/#findComment-1208951 Share on other sites More sharing options...
snwspeck Posted May 1, 2011 Author Share Posted May 1, 2011 im not sure...you would have to search the code for the var $products and see what it stores Read the PM I sent you please but I am really lost. Quote Link to comment https://forums.phpfreaks.com/topic/235253-foreach-error/#findComment-1208953 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.