Jump to content

query won't execute


cheryl

Recommended Posts

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

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

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

[!--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

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.