$sizes = array(json_decode($_POST["sizeValues"]));// $id = $_POST["id"];
print_r($sizes);foreach($sizes as $size){
$name = intval($size->item_name);
$id = intval($size->item_id);
$sql ="UPDATE patron_sizes SET size_count='$name', WHERE id=$id";
$result = $conn->query($sql);if($result){
echo 'done';}}
أواجه الخطأ التالي
Notice:Trying to getproperty'item_name' of non-objectin<b>C:\xampp\htdocs\atms\requests\edit_patron.php</b> on line 35Notice:Trying to getproperty'item_id' of non-objectin<b>C:\xampp\htdocs\atms\requests\edit_patron.php</b> on line 36
السؤال
محمد المصري12
سلام عليكم
أحاول تحديث قاعدة البيانات ببيانات مصفوفة كالتالي
أواجه الخطأ التالي
المصفوفة تطبع بالشكل التالي
Array ( [0] => Array ( [0] => stdClass Object ( [item_id] => 2758 [item_name] => 5000 ) [1] => stdClass Object ( [item_id] => 2759 [item_name] => 4000 ) [2] => stdClass Object ( [item_id] => 2760 [item_name] => 6000 ) [3] => stdClass Object ( [item_id] => 2761 [item_name] => 0 ) [4] => stdClass Object ( [item_id] => 2762 [item_name] => 2 ) [5] => stdClass Object ( [item_id] => 2763 [item_name] => 2000 ) [6] => stdClass Object ( [item_id] => 2764 [item_name] => 2000 ) [7] => stdClass Object ( [item_id] => 2765 [item_name] => 2000 ) [8] => stdClass Object ( [item_id] => 2766 [item_name] => 2000 ) [9] => stdClass Object ( [item_id] => 2767 [item_name] => 2000 ) [10] => stdClass Object ( [item_id] => 2768 [item_name] => 10000 ) [11] => stdClass Object ( [item_id] => 2769 [item_name] => 5000 ) [12] => stdClass Object ( [item_id] => 2770 [item_name] => 2500 ) [13] => stdClass Object ( [item_id] => 2771 [item_name] => 2500 ) [14] => stdClass Object ( [item_id] => 2772 [item_name] => 5000 ) ) )
ما الحل فضلا ؟
2 أجوبة على هذا السؤال
Recommended Posts
انضم إلى النقاش
يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.