It's maybe very silly, but I have problem with creating php variables from MySql. To be more clear I have a problem with names of variables!
My code:
<?
$result = $mysqli->query("SELECT * FROM items") or die(mysql_error());
$data = array();
while($row = $result->fetch_array()) {
$data['price' . $row['varname']] = $_row['price'];
//// trying to get set of variables, example:
$priceitem01 = $row[price];
$priceitem02 = $row[price];
etc....
$data['name' . $row['varname']] = $row['name'];
//// trying to get set of variables, example:
$nameitem01 = $row[name];
$nameitem02 = $row[name];
etc... ?>
Please could you help my here, cause I'm stuck. Tried some solutions with no success and I have a feeling is very basic piece of knowladge. Thanks a lot.