I do have a PHP script with run fine on my local sever. When i do upload to the production sever it dose not function correctly.
My local sever uses Apache/2.2.22 (Win32) PHP/5.4.5.
Here is an example of the code.
// The shopping cart needs sessions, so start one
$itemId = $_GET['itemid'];
// get this book out of database
$items = get_item_details($itemId);
foreach($items as $item)
// set url for "continue button"
$target = "index.php";
$target = "show_cat.php?catid=".$item['CATEGORY_ID'];
// if logged in as admin, show edit book links
display_button("edit_item_form.php?itemid=".$itemId, "edit-item", "Edit Item");
display_button("admin.php", "admin-menu", "Admin Menu");
//display_button($target, "continue", "Continue");
display_button("show_cart.php?new=".$itemId, "add-to-cart", "Add ".$item['ITEM_NAME']." To My Shopping Cart");
display_button($target, "continue-shopping", "Continue Shopping");
Here is the problem, on my local sever I must include the foreach loop to access the array from the Sql query. On the production sever it tells me i do have an wrong foreach construct. Help please.
It would help to see the exact error message(s) you are getting. My guess is that the DB query is not working, and therefore $items is false or null instead of being an array, which is what the first argument to foreach() must be.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation