| CodeHeads 2006-02-25, 9:43 am |
| --=-YjIJEa8+/ubFUxdYsE7p
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Wed, 2006-02-22 at 16:49 -0600, Ariel S=C3=A1nchez Mora wrote:
> So far i've been able to store ip addresses as strings like you would
> type them in DOS, for ex, '192.168.0.1'. This serves me great since my
> application uses IP addresses as strings in all cases. I've done
> queries with the IP column , for example, select office_name from
> table_1 where ip=3D'10.100.1.1'; and have never had any problems.
> However, if you plan on sorting based on this column, strings with
> periods do not behave correctly, and the answers to my previous
> question on this list do not apply; it makes a good aproximation,
> though.
>=20
> Hope this helps, but I must admit I am not sure if this answers your
> question. An example in the mysql console would be great for clearing
> up your objetive.
>=20
> Regards,
>=20
> Ariel=20
OK, I think I did not explain things right the first time. :(
I have a table like so:
CREATE TABLE `portal_forums_users
` (
`user_id` bigint(255) NOT NULL auto_increment,
`ip` varchar(200) default NULL,
`signup_date` varchar(30) default NULL,
`city` varchar(200) default NULL,
`state` varchar(100) default NULL,
`email_address` varchar(200) default NULL,
`username` varchar(100) default NULL,
`password` varchar(100) default NULL,
`yim` text,
`aol` text,
`web_url` text,
`post_count` varchar(255) default NULL,
`info` text,
`sig` text,
`avatar` text,
`css_id` int(11) default NULL,
`mod_f` varchar(20) default NULL,
`admin` varchar(20) default NULL,
PRIMARY KEY (`user_id`),
FULLTEXT KEY `full_index`
(`city`,`state`,`use
rname`,`email_addres
s`,`ip`)
) ENGINE=3DMyISAM DEFAULT CHARSET=3Dlatin1;
Notice the FULLTEXT; I have the ip listed to be indexed. Using a PHP
script I have it will not grab the IP that I am searching for, even
though it *is* in the database. The ip's are entered into the database
as 192.168.1.10. When I search for a username it works great.
Is it because of the "." (periods) in the search string??
Hopefully I explained that right this time!! :) LOL
--=20
Best regards,
~WILL~
Key: http://code-heads.com/keys/ch1.asc=20
Key: http://code-heads.com/keys/ch2.asc=20
Linux Commands: http://code-heads.com/commands=20
Linux Registered User: 406084 (http://counter.li.org/)
--=-YjIJEa8+/ubFUxdYsE7p
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (GNU/Linux)
iD8DBQBD/ PU6fw3TK8jhZrsRApwlA
J4yT7HCNF9tBqDnEP0kr
aTU8mz01gCeP66L
RB79EvWpWMrxXMmSuiny
bG4=
=+UUf
-----END PGP SIGNATURE-----
--=-YjIJEa8+/ubFUxdYsE7p--
|