Jump to content

Archived

This topic is now archived and is closed to further replies.

cheryl

query won't execute

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
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]

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

×

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.