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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.