Iam trying to place data from SQL into array and simultaneously make the same array associated with name of source columns. This is function, what I got:
GetRowFromDb("`id`,`name`,`email`", " WHERE `id`='1'", "database1", "table1");
function GetRowFromDb ($column, $condition, $database, $table) {
$target="`$database`.`$table`";
$query="SELECT $column FROM $target $condition";
$indexedrow=mysql_fetch_row(mysql_query($query));
return $indexedrow;
}
This gives me back indexed array. When I want to know email, I need to use index (number) for example $result[2]. But I want to make my array associative with name of source columns, like this
print $result[email] //should return email
Thanks for reply! Marcel