Jump to content
Lizard Wizard Coding Club

kama1983

New Members
  • Content Count

    2
  • Joined

  • Last visited

Community Reputation

0 Neutral

About kama1983

  • Rank
    New member
  1. calculate row 1 + row 2 and add them to final result you can do it for example : <?php $con = mysql_connect("localhost", "peter", "abc123"); if (!$con) { die('Could not connect: ' . mysql_error()); } $db_selected = mysql_select_db("test_db",$con); $sql = "SELECT * from Person"; $result = mysql_query($sql,$con); while($row = mysql_fetch_array) { $row1 = $row[0 or name your field]; $row2 = $row[1 or name your field]; echo $row1 + $row2; } mysql_close($con); ?>
  2. calculate row 1 + row 2 and add them to final result you can do it for example : <?php $con = mysql_connect("localhost", "peter", "abc123"); if (!$con) { die('Could not connect: ' . mysql_error()); } $db_selected = mysql_select_db("test_db",$con); $sql = "SELECT * from Person"; $result = mysql_query($sql,$con); while($row = mysql_fetch_array) { $row1 = $row[0 or name your field]; $row2 = $row[1 or name your field]; echo $row1 + $row2; } mysql_close($con); ?>
×
×
  • Create New...