query( $sql ); if ($loc_db->num_rows() > 0) { $sql = "UPDATE stats SET operational = " . operational_nodes() . ", testing = " . testing_nodes() . ", building = " . building_nodes() . ", gathering = " . gathering_nodes() . ", interested = " . interested_nodes() . ", total = " . total_nodes() . ", interfaces = " . total_interfaces() . ", links = " . total_links() . " WHERE the_date=now()"; } else { $sql = "INSERT INTO stats VALUES(now(), " . operational_nodes() . ", " . testing_nodes() . ", " . building_nodes() . ", " . gathering_nodes() . ", " . interested_nodes() . ", " . total_nodes() . ", " . total_interfaces() . ", " . total_links() . ")"; } $loc_db->query( $sql ); ?>