LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   compare $php variable to indexed distinct mysql columns (https://www.linuxquestions.org/questions/programming-9/compare-%24php-variable-to-indexed-distinct-mysql-columns-622119/)

secretlydead 02-18-2008 08:46 PM

compare $php variable to indexed distinct mysql columns
 
i'm writing a program where a php $variable has to be compared to mysql select distinct column1, column2, where column1,column2 has a unique index. how do i write the mysql query for that without using concat?

in other words, i don't want to use, select * from table where $variable = concat(column1,column2); i would like instead to make use of the index.

chrism01 02-18-2008 10:48 PM

Do you mean:
1. compare var to all distinct combos of concat(col1,col2)
OR
2. retrieve row where var = concat(col1,col2)
??


All times are GMT -5. The time now is 02:55 AM.