cheryl Posted April 10, 2006 Share Posted April 10, 2006 [code]$search_participant = "SELECT * FROM " .$clientCode. "m WHERE memName LIKE '%$namesearch%' ORDER BY memCode";[/code]is this query won't execute. is there a problem with joining the .$clientCode. to the m? Quote Link to comment Share on other sites More sharing options...
willpower Posted April 10, 2006 Share Posted April 10, 2006 I think its because you have double quotes around $clientCode. try changing it to $search_participant = "SELECT * FROM ' .$clientCode. 'm WHERE memName LIKE '%$namesearch%' ORDER BY memCode";...and whats the m for...is this just a typo? and add single quotes around memName 'memName'Try that and see Quote Link to comment Share on other sites More sharing options...
cheryl Posted April 10, 2006 Author Share Posted April 10, 2006 the query still won't execute. by the way, the m isn't a typo. the $clientCode is suppose to join to the m to get $clientCodem table. [!--quoteo(post=363250:date=Apr 10 2006, 05:31 AM:name=willpower)--][div class=\'quotetop\']QUOTE(willpower @ Apr 10 2006, 05:31 AM) [snapback]363250[/snapback][/div][div class=\'quotemain\'][!--quotec--]I think its because you have double quotes around $clientCode. try changing it to $search_participant = "SELECT * FROM ' .$clientCode. 'm WHERE memName LIKE '%$namesearch%' ORDER BY memCode";...and whats the m for...is this just a typo? and add single quotes around memName 'memName'Try that and see[/quote] Quote Link to comment Share on other sites More sharing options...
Barand Posted April 10, 2006 Share Posted April 10, 2006 I suggest you add some error trapping code[code]$search_participant = "SELECT * FROM " .$clientCode. "m WHERE memName LIKE '%$namesearch%' ORDER BY memCode";$result = mysql_query($search_participant) or die (mysql_error() . ' <br>' . $search_participant );[/code]and what error do you get. Quote Link to comment Share on other sites More sharing options...
cheryl Posted April 11, 2006 Author Share Posted April 11, 2006 [!--quoteo(post=363404:date=Apr 10 2006, 02:15 PM:name=Barand)--][div class=\'quotetop\']QUOTE(Barand @ Apr 10 2006, 02:15 PM) [snapback]363404[/snapback][/div][div class=\'quotemain\'][!--quotec--]I suggest you add some error trapping code[code]$search_participant = "SELECT * FROM " .$clientCode. "m WHERE memName LIKE '%$namesearch%' ORDER BY memCode";$result = mysql_query($search_participant) or die (mysql_error() . ' <br>' . $search_participant );[/code]and what error do you get.[/quote]the error is Couldn't execute query. Quote Link to comment 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.