Friends - gives something wrong =) Ie not the data that is in the database. Here's the code, skip what's wrong, because if without a cycle, it will produce the first value! And so the error: Warning: Illegal string offset 'product_id' in /home/virtwww/w_ptichshop-ru_5dba0c7b/http/tesst.php on line 12

<?php include ('connect.php'); $seller_id = $seller['seller_id']; $querys222 = "SELECT * FROM oc_ms_order_product_data WHERE (seller_id = 12)"; $results222 = mysql_query($querys222); $storeser222 = mysql_fetch_array($results222); foreach ($storeser222 as $value222) { $ord_id = $value222['product_id']; echo $ord_id; } ?> 

    1 answer 1

    You are not using mysql_fetch_array correctly . Perhaps this option will suit:

     while ($storeser222 = mysql_fetch_array($results222)) { $ord_id = $storeser222['product_id']; echo $ord_id; } 
    • Thanks, but prints everything except the first value - lxxnutsxxl
    • Did you $results222=mysql_query(...) entire code for sure, after the $results222=mysql_query(...) ? - S. Pronin
    • Yes, yes, everything is OK, thanks, the extra line was, thanks again! - lxxnutsxxl 2:46 pm
    • no problems) - S. Pronin