Jump to content

This is weird....


Neptunus Maris

Recommended Posts

This is all the sudden not working

 

        $networking = 0;

 

        //i did all the database selection...bla bla bla

while ($row = mysql_fetch_array($result)) {

$networking += $row[networking];

} //end while

 

        print "$networking";

 

I'm try to increment the value of $networking, which starts at 0 then while loops through database results, which ARE integers in their fields i.e. `networking` tinyint(1) unsigned NOT NULL default ''.

 

Say if I have 50 table rows for that. I want to loop through the `networking` field to count all (integer values can be anywhere from 0-99) and add them to the $networking variable as displayed in the while() as $networking += $row[networking];

 

It is not doing that $networking just shows up as 0.

 

Does anyone know anything about this.

 

Thanks for the help in advance!

 

-Neptune

Link to comment
https://forums.phpfreaks.com/topic/64087-this-is-weird/
Share on other sites

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.