Forum Moderators: coopster

Message Too Old, No Replies

How do i query my database and display the result

query MySQL and display result

         

gkkarthik

8:44 am on Oct 16, 2007 (gmt 0)

10+ Year Member



I am trying to query my database for a first name and display the result. This is for the users of the association to search for members.

$qry = "select FIRST_NAME,LAST_NAME,CITY,EMAIL from SA_REGISTRATION where FIRST_NAME = "'.S_POST["FIRST_NAME"]'";

echo '@mysql_query($qry)';

I am a newbie to PHP and am not familiar with SQL either...
please help me

Habtom

9:05 am on Oct 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have made a couple of changes on your sql query:
$qry = "SELECT FIRST_NAME,LAST_NAME,CITY,EMAIL from SA_REGISTRATION where FIRST_NAME = "'.$_POST['FIRST_NAME']'"";

$query = mysql_query($qry);

while ($row = mysql_fetch_array($query)) {
echo $row['FIRST_NAME'];
. . .
.. . .
}

gkkarthik

9:40 am on Oct 16, 2007 (gmt 0)

10+ Year Member



Hi Habtom,
Thanks...i'm testing the query now...will keep you updated.
Thanks again,
Karthik

Habtom

9:44 am on Oct 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not a problem gkkarthik, Welcome to WebmasterWorld.