Hello!
Can someone tell me how to write the counter correctly to add an array to the database?
I tried dozens of options - it does not work!
Essence: inside the $ array array (this is a brand) there will be a key ['models'] - and in it, in order, starting with [1], different models of machines are entered.
if ($ target == "add_model") {
$i=1;<br> // different info about $ @ _ POST;
$far=array('model_name'=>$mod_name, 'opisanie'=>$opisanie);<br> $array = array('ааа'=>$asd);<br> $array['models']['$i++']=$far; // счетчик некорректно записан!<br> $json=(json_encode($array));<br> $sql = "UPDATE marki SET json='$json' WHERE id=$marka_id";<br> $res = mysqli_query($connect,$sql);<br> echo "<script>window.location='index.php'</script>";<br> }
?>
['$i++']well ++ surely it will never be executed inside quotes, why are they even write just[$i++]- Mike