This may be a very simple question, but I've tried many different ways to attempt this only to find syntax errors. I have the following code:
$query = "SELECT * FROM plyr where posid = '4' order by teamname";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
[
$dd .= "<option value='{$row['name']}'>{$row['name']}, {$row['teamname']}]</option>";
}
echo"<label for=\'choice4[]\'>Select Two Players:</label><br>
<select multiple=\"multiple\" name=\"choice4[]\">
<option value=\"$dd\">$dd</option>
</select>";
to which I'd like to add some statistical averages to $dd. The statistics are stored in my db as integers, so I need to do some on the fly calculations to get averages to display. For example, I'd like to add PPG but need to add in an equation for pts/gm and not sure how to do that. I've tried to do {$row['pts'/'gm']} and {$row['pts']/$row['gm']} and other methods but I'm not hitting on the right one. Any help is very appreciated!