Is there a way i can make the following code a single variable or function
$result = mysql_query("SELECT * FROM a0pg3_mikes WHERE pkey=".$pkeyurl);
while ($custrow = mysql_fetch_array($result)) {
}
?>
I want to put this in my functions.php file and call the whole lot with something like...
<?php echo $custrow{'custname'};?>
I have been finding that the echo must be between the "while {}" If i use the echo on a seperate php like the above, it doesn't work. I am very new to this level of coding and beginning to push myself.
Many Thanks.