Associate
- Joined
- 4 May 2003
- Posts
- 582
Guys.
I have a database table that contains a field, lets call it x. The field x contains a n ip address number.
I wish to retrieve this and analyse only the first octet.
For instance in the IP 192.168.0.1 I only want to analyse the 192 part. I have been using the PHP command split to do this. This I believe splits each IP address into an array containing four values (one for each octet).
I have the following sql select statement.
select x from table_name;
I then use mysql_fetch_array to retrieve the IP address values.
This is where I get stuck.
I have two more variables $y and $z which are integers, I wish to evaluate each value I retrieved from the select statement to see if it is greater that 65. If it is greater than 65 I wish $y to increase by one and if it is less that 65 I wish $z to increase by one.
Does Anyone have any pointers? I am pulling my hair out here
Thank You In Advance
I have a database table that contains a field, lets call it x. The field x contains a n ip address number.
I wish to retrieve this and analyse only the first octet.
For instance in the IP 192.168.0.1 I only want to analyse the 192 part. I have been using the PHP command split to do this. This I believe splits each IP address into an array containing four values (one for each octet).
I have the following sql select statement.
select x from table_name;
I then use mysql_fetch_array to retrieve the IP address values.
This is where I get stuck.
I have two more variables $y and $z which are integers, I wish to evaluate each value I retrieved from the select statement to see if it is greater that 65. If it is greater than 65 I wish $y to increase by one and if it is less that 65 I wish $z to increase by one.
Does Anyone have any pointers? I am pulling my hair out here

Thank You In Advance