${$table}_result= mysql_query("SELECT * FROM `$table` WHERE `$targetfield`='$variable' LIMIT 1");
$num_{$table}_cols= mysql_num_fields(${$table}_result);
for($i=1;$i<=$num_{$table}_cols;$i++){
$field=mysql_fetch_field(${$table}_result, $i);#mysql_fetch_field(result, field_offset)
${$table}_{$field}= mysql_result(${$table}_result, 0, $field);
}
This is my script to load values from a database into variables with the format "tablename_fieldname". However I get a parse error on the first line and I don't see whats wrong with it.
Can anyone help?