Hi guys! I'm just new to PHP, and I am really having a hard time with it. Could you please help me? ^^ I'm suppose to create a page that will tally all the inputted fields in a table. Each inputted field is equivalent to "1" and each empty field is equivalent to "0". If a field isn't empty then all inputted fields should be sum up. Here's my code...
$VesselApproached = $row['VesselApproached'];
if (empty($VesselApproached))
{
$VesselApproached = 0;
}
else
{
$VesselApproached = 1;
}
if ($VesselApproached = 1)
{
$query_1a = "SELECT SUM(VesselApproached) FROM i_questionnaire_1a";
$result = mysql_fetch_array($query_1a);
{
echo "$VesselApproached";
}
}
I really don't know where to start here. I just searched codes from the internet to help me out.. The problem is... its still not working... Ouch!