Jump to content

query help


esport

Recommended Posts

Hey guys,
Having some problems trying to get my query to work.
I have a query where it select the first character of the company feild, but if there is no company it then selects the first character of the surname. I was wondering how to go about it. Below is a snippet of what i currently have.

[code]SELECT * FROM contacts
WHERE  left(company,1)='$letter'[/code]

How do i do it if compnay is null so then search in surname.

Thanks

Daniel
Link to comment
https://forums.phpfreaks.com/topic/17686-query-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.