Re: Still trying to figure this out...
| From: | Rob W. | Date: | Tue, 20 Jun 2006 06:56:20 +0000 |
| Subject: | Re: Still trying to figure this out... | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-238380@lists.php.net to get a copy of this message | ||
OMG Chris, Thankyou very much. That is exactally what I needed. If you wish for me to pay you some amount, I will be very happy to. Please send me a private email where I can paypal you. If not, Thank you again very much for the help.
Sorry everyone for the hastle for those of you wernt able to help with what I wanted.
- Rob
----- Original Message ----- From: "Chris" <dmagick@gmail.com>
To: "Rob W." <rob@fiberuplink.com>
Cc: <php-general@lists.php.net>
Sent: Tuesday, June 20, 2006 1:39 AM
Subject: Re: [PHP] Still trying to figure this out...
Rob W. wrote:I still have not yet found anybody to help me with this. All the code that people have given me has not worked at all. I still get no output. So to add a little more to this, I'm gonna define how the database looks. ----------------------------------I'm sure the code that people have posted will work if you do more than just copy/paste it and try to understand it and match it to what you want. $switch_ports_taken = array(); $query = "select switchport from table where switchid=1"; $result = mysql_query($query); if (!$result) die("error: " . mysql_error()); while($row = mysql_fetch_assoc($result)) { array_push($switch_ports_taken, $row['switchport']); } echo "Got these ports: " . print_r($switch_ports_taken, true) . "<br/>"; $all_ports = range(1,24); $unused_ports = array_diff($all_ports, $switch_ports_taken); echo "Unused ports: " . print_r($unused_ports, true) . "<br/>"; If that doesn't work tell us what doesn't work and don't make us guess what's going on. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php| switchid | switchport |----------------------------------| 1 | 1 | | 1 | 2 | | 1 | 3 | | 1 | 4 | | 1 | 7 | | 1 | 10 |----------------------------------