I’m having trouble getting my code to echo the right thing from my database.
The function sends in two numbers ($id and $pNum). I have checked those numbers and the values in my database.
[php]function randomEventPrize($id,$pNum){
$pT = $pNum."_te"; //either 1_te, 2_te, or 3_te
$pP = $pNum."_re"; //either 1_re, 2_re, or 3_re
$re = mysql_fetch_assoc(mysql_query(“SELECT ‘$pT’,’$pP’ FROM randomE
WHERE id
=’$id’”));
echo $re[$pT];
echo $re[$pP];
}[/php]
The echo statements echo the $pT and $pP values and not what’s in the database. What’s the correct syntax to do this?