I'm sort of new at this stuff, and I was just wondering if it's possible and/or good practice to put query's inside of query's. For example:
$result = mysql_result(mysql_query("SELECT * FROM employees WHERE name=$name", $db),0,"name");
Or do you have to do it the long way and create another variable:
$query = mysql_query("SELECT * FROM employees WHERE name=$name", $db);
$result = mysql_query($query,0,"name");
And I know the second one is probably easier to read, but being more concerned about optimization, could it be better (and possible) to spare a variable and just put the two query's together like that?
Thanks,
Glen