noj75 Posted January 15, 2009 Share Posted January 15, 2009 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 https://forums.phpfreaks.com/topic/140921-please-help-with-this-query/ Share on other sites More sharing options...
RussellReal Posted January 15, 2009 Share Posted January 15, 2009 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 https://forums.phpfreaks.com/topic/140921-please-help-with-this-query/#findComment-737633 Share on other sites More sharing options...
sasa Posted January 15, 2009 Share Posted January 15, 2009 This does work but is TERRIBLY slow. Is there another way to do this? can you explain TERRIBLY (more then 0.01 sec?) Link to comment https://forums.phpfreaks.com/topic/140921-please-help-with-this-query/#findComment-737704 Share on other sites More sharing options...
noj75 Posted January 15, 2009 Author Share Posted January 15, 2009 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 https://forums.phpfreaks.com/topic/140921-please-help-with-this-query/#findComment-737712 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.