Re: Re: Retrieve specific data from MySQL

From: Date: Tue, 03 Feb 2004 03:53:09 +0000
Subject: Re: Re: Retrieve specific data from MySQL
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-176654@lists.php.net to get a copy of this message
Matt Hedges wrote:
Thank you for your replies... I have it showing the last name... but what I can't figure out is how for it to reference to the whole entry. So, for example, when someone enters to search for the last name "Smith," all the "Smiths" are pulled up, sorted by first name and linked by id. How do I do this? thank you very much, Hedges
SELECT * FROM dbName.tableName WHERE lastname LIKE '%$lastname%' ORDER BY firstname And look here for how to execute your query... http://us4.php.net/manual/en/function.mysql-query.php And here on how to loop thru the result set... http://us4.php.net/manual/en/function.mysql-fetch-array.php -- By-Tor.com It's all about the Rush http://www.by-tor.com

« previous php.general (#176654) next »