No, but ok here goes the whole thing and sorry if I didnt explain this to everyone before.

I am trying to duplicate a program that keep's track of server information, switch ports, apc ports ect ect...

In the one column is switchports

This lists a total of 24 or 48 or how many ever ports are on that switch.

With in there is numbers like this for example:

1
2
3
4
5
6
7
10
11
12
13
14
15

ect... Hopefully that help's so far.

As far as listing the numbers is ok, I can pull it from the db and list all the numbers just fine in numerical order as they are listed.

My problem is inside this script, when a new server is added, it pulls the information from the database and finds an empty number, which is why, though the whole list of 1 though 24 i need to get the information of the missing numbers. These missing numbers HAFT to be dynamic and can not be hard coded in because servers are always moved around and changed and added. I hope this information was helpful for those of you trying to help solve my problem.

- Rob

----- Original Message ----- From: "João Cândido de Souza Neto" <[EMAIL PROTECTED]>
To: <php-general@lists.php.net>
Sent: Sunday, June 18, 2006 8:38 PM
Subject: [PHP] Re: Ok next php problem


If i understood right, you want to list a sequence of numbers and follow some data like:

1 - data of number 1
2 - data of number 2
...

If it's right, you can do it.

$query="SELECT * FROM db ORDER BY numbers DESC limit 1";

$maxnum=$numbers;

for ($num=1;$num<=$maxnum; $num++) {
   $query="SELECT * FROM db where numbers=".$num;
   echo $num." - ".$data."<br>";
}



""Rob W."" <[EMAIL PROTECTED]> escreveu na mensagem news:[EMAIL PROTECTED]
I got the previous question answered, Now here's my next problem.

With the numbers displaying correctly again I got:

1
2
3
4
5
6
7
10
11
12
13
14
15
16
17
18
19
20
21
22
25

listed in that order in the database

Now i'm trying to figure out how to write a syntax saying that if like number 8 isnt listed, display it.

I've tried doing a

if ($count != $data) {
 echo "$data";
}
$count++;

But when I get to like id number 9 it dont work right because the next entrie is displayed as 10 in the db. So that's my problem is to try and display only them numbers that are not in there. I have also tried putting the numbers in to an array and matching from there but it still come's up as the same as above.

- Rob

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to