Jump to content

query won't execute


cheryl

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.