codingbenn Posted November 20, 2012 Share Posted November 20, 2012 well I have a mysql with 3 columns which are called ID, firstName, lastName. I want to search for a name and it then return the ID? thanks little bit of the database; ID firstName lastName 100033 Stijn Stijnen 1001 Gábor Király 100143 Frederik Boi 100264 Tomasz Szewczuk 100325 Steeve Joseph-Reinette 100326 Kamel Chafni 100329 Abdoulaye Faye 100330 José Saez 100387 Richard Spong 100391 Laurent Delorge 100470 Michael Ingham 100521 David Noble 100557 Brian Barry-Murphy 100559 Paul McKenna 100578 Richard Cresswell Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted November 20, 2012 Share Posted November 20, 2012 SELECT your_id_field FROM your_table WHERE your_first_name_field = 'first_name' AND your_last_name_field = 'last_name' Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.