Jump to content

[SOLVED] I've got a recordset i would like to add the numeric values of.... help???


waynem801

Recommended Posts

Ok, so i've gotten this far, i've been able to display the record set "SCORE" in a table..

Here's my problem, I want to be able to add the Numeric values of all the record set.

 

Example:

"Score"

1

5

9

10

3

etc.....

The total of this = 28...

So how do i get php to add the data in the record?

 

Thanks,

Wayne

 

 

$con = mysql_connect("#########", ######", "#########");

if (!$con)

  {

  die('Could not connect: ' . mysql_error());

  }

 

mysql_select_db("######", $con);

 

$result = mysql_query("SELECT * FROM #######);

 

echo "<table border='1'>

<tr>

<th>score</th>

<th>course rating</th>

</tr>";

 

while($row = mysql_fetch_array($result))

  {

  echo "<tr>";

  echo "<td>". $row['score']."</td>";

  echo "</tr>";

  }

echo "</table>";

 

 

mysql_close($con);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.