Issue Adding Variable Fields

The issue I am having is that I want to be able to add all of the rows that start with “event_”, here is what I have so far.


$result = mysql_query(“SELECT event_* FROM students WHERE studentid = ‘$sid’”) or die(mysql_error());
while($row = mysql_fetch_array( $result ))

$totalpoints = $totalpoints + $row[‘event_*’];

echo $totalpoints;

The reason I need a variable is because there will be more columns added every some often from a panel.

Sponsor our Newsletter | Privacy Policy | Terms of Service