Hi everybody!
I’ve a simply phonebook (addressbook) with some field: firstname, lastname, for name and lastname and home, mobile and work for phone number.
Now I’ve setup this query on callerid lookup:
SELECT firstname
, lastname
FROM addressbook
WHERE home
LIKE ‘%[NUMBER]%’ or mobile
LIKE ‘%[NUMBER]%’ or work
LIKE '%[NUMBER]%'
but on my sip phon (Spa942) I see only the firstname.
Any suggestions?
Is your formatting correct, I barely understand it but I do a similar thing and my query looks like this
SELECT name FROM user1 WHERE out
LIKE ‘[NUMBER]’
But I’ve two field into mysql query, and phone show me only the first field.
Your phone is probably expecting a single string field. One solution is to combine your firstname and lastname fields into a single calculated field. For mysql, try something like this:
SELECT Concat(`firstname`, ' ', `lastname`) AS first_last
FROM `addressbook`
WHERE `home` LIKE '%[NUMBER]%'
OR `mobile` LIKE '%[NUMBER]%'
OR `work` LIKE '%[NUMBER]%'
You’re great! all works fine! Many thanks.