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? Link to comment https://forums.phpfreaks.com/topic/7006-query-wont-execute/ 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 Link to comment https://forums.phpfreaks.com/topic/7006-query-wont-execute/#findComment-25452 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] Link to comment https://forums.phpfreaks.com/topic/7006-query-wont-execute/#findComment-25458 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. Link to comment https://forums.phpfreaks.com/topic/7006-query-wont-execute/#findComment-25605 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. Link to comment https://forums.phpfreaks.com/topic/7006-query-wont-execute/#findComment-25718 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.