John W. Holmes wrote:
I'd probably put the ip address to name mapping in a separate table. If we call that table "nameip" and it has fields "name" and "ip", and if your other table is "othertable" with a "ip" field then you can begin your sql statement with something like:.....it's an log for a VoIp network, evrey voip has an ip and i whant that instad of the VoIp's IP to put his name, instad of "1.1.1.1:xxx"mustbe "jhon doe form yyy city", it's easier to read for the people whoSo where do you get the name from. You're still not being descriptive enough.
select nip.name
from nameip nip, othertable ot
where nip.ip = ot.ip
and ot.ip = whatever you need to get the right record.
The above is untested and you may need to modify it to suit your database's syntax (you do not tell us which), but it should give you the general idea.
Sean, the difficulty is that you were not explaining what you wanted clearly enough, not giving us enough information. It took several posts to do that. John's simple answer "yes" was a humourous hint to that. All we knew is the few lines of your original post, we don't know if you are ace programmer and database wizard or newbie. You know what you want to achieve and the backgroud to it, we do not. You know your response was out of line. I think a simple apology would be appreciated. John is a mainstay of this list and deals with many requests for help per day. Its a high volume list, please stay on it yourself and find out. See if you can help others.
Its also php-general so should really be for requests that do not fall into other catagories such as php-db, php-install or mysql, its not a database list. I feel that many people post to this list, even with off-topic questions, because they know they will receive help. Why? Simply because there are people such as John who wade through hundreds of posts every day, putting themselves out, and doing their best.
Regards
Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php