I'm not very well versed in php and i'm having a problem defining a variable. I know i'm going about it the wrong way so I thought i'd throw it to y'all.
I want to take and make this entire series here into a variable:
$res = mysql_query("SELECT tech_last, tech_first, FROM $table2 ORDER BY tech_last")
or die("Unable to pull Tech Information" . mysql_error());
for($i = 0; $i < mysql_num_rows($res); $i++)
{
$temp = mysql_fetch_row($res);
print("<option value=\"$temp[0], $temp[1]\">$temp[0], $temp[1]</option>\n");
}
This is obviously to populate a select box. I want to be able to make all of the above a variable. How would I go about doin' that?
I currently have this particular query on quite a few pages and, even though its not bandwidth intensive, I'd like to make it a single variable so I don't have to run the query on each page.
Thanx much!
Nico