bluetiger Posted June 14, 2007 Share Posted June 14, 2007 hi i am trying to search multipul fields in my database i have tried this code [code] SELECT * FROM Profile WHERE Location1 = 'colname' OR Location2 = 'colname' OR Location3 = 'colname'; but its giving me this error Missing type for variable:colname Any suggestions on this. thanks[/code] Quote Link to comment https://forums.phpfreaks.com/topic/55544-sql-search-query/ Share on other sites More sharing options...
christofurr Posted June 14, 2007 Share Posted June 14, 2007 So you have a table named Profile which consists, at least, of three columns named Location1, Location2, and Location3, and you're trying to search each of those columns for the string "colname"? Quote Link to comment https://forums.phpfreaks.com/topic/55544-sql-search-query/#findComment-274460 Share on other sites More sharing options...
bluetiger Posted June 14, 2007 Author Share Posted June 14, 2007 Yes instead of doing loads of individual querys i wanted to try and use just the one as there is going to be more than just for the location. Quote Link to comment https://forums.phpfreaks.com/topic/55544-sql-search-query/#findComment-274465 Share on other sites More sharing options...
MemphiS Posted June 14, 2007 Share Posted June 14, 2007 Could you post a few more lines of code before and after... Also colname? i would assume is a variable? Quote Link to comment https://forums.phpfreaks.com/topic/55544-sql-search-query/#findComment-274466 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.