Jump to content

Please help with this query.


noj75

Recommended Posts

Hi to all on this great site! I am desperate for some help:

 

$samesurn = "SELECT * FROM $stb WHERE s_sur IN (SELECT s_sur FROM $stb WHERE s_name='$proname') AND s_name!='$proname' ";

 

I am trying to do the above query:

 

$proname has a list of values in s_sur. I want to query the database to see who else has the same values and then display the results excluding $proname's own results.

 

This does work but is TERRIBLY slow. Is there another way to do this?

 

Any help is greatly appreciated. Thank you.

Link to comment
Share on other sites

okay

 

first I want to recap:

$proname looks like it would be "first name"

 

I want to just make it clear that it is possible for people to name their kids their same name.. like

Russell Crevatas, Senior

Russell Crevatas, Junior

 

I'm stil not completely sure what this should be doing.. but you want everybody with the same last name, but not the same first name?

Link to comment
Share on other sites

Hi,

 

OK, $proname (s_name) is the username. So, if I ($proname) have entered a load of surnames into s_sur and I want to see who else (i.e which other usernames) have entered the same surnames as me I would have to query the database and show me the results. I only want to list other members surnames and exclude my own.

 

Does that clear it up?  ???

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.