I have a query that I would like to run to input data into my MySQL database. It is working fine with pure text and numbers, but inputting variables in:
$base_ids = 4;
while($j <= $base_ids){
$row = array(keygenb());
foreach($row as $value){
$query = "INSERT INTO webstore(col_1) VALUES('".$value."')";
echo $query;
$result = mysqli_query($con,$query);
}
$j++;
}
When I echo $query, there is a problem with the VALUES('".$value."')"; Echoing $query gives me this: ($value = XBox-CJbf-Ont4-B7kk)
INSERT INTO webstore(col_1) VALUES('')XBox-CJbf-Ont4-B7kk
The $value gets stuck on the end, rather than put between the quotes where it can be executed. I'm sure this is an easy fix, however I've tried to get around it a few ways and haven't yet found a way that works.
Many thanks,
Mem