Hi there,
I've wondered for a long time, is there a way to retrieve an array from MySQL and assign in one go?
For example, if I need to retrieve a country name from a database, I would normally do this:
$get_country = mysql_fetch_array(mysql_query('SELECT * FROM countries WHERE id ="45"'));
$country = $get['name'];
I could use $get_country['name'], but is there a way to assign an array item to a variable, but also having the MySQL fetch array in the same line?
So it would look something like this:
$country = mysql_fetch_array(mysql_query('SELECT * FROM countries WHERE id ="45"'))[AND_ASSIGN_$country['name']_TO_$country];