Jump to content

help! returning a single row on a database query


lee20

Recommended Posts

i\'m trying to query the database and only get one result. i\'ve always used while loops when i query the database, but i need to query for the first matching criteria and return that row.

 

$select = \"SELECT * FROM `table Where value=\'$variable\'\";

$query = mysql_query($select);

while($row = mysql_fetch_row($query))

{

//I want to return only the first row with the matching criteria.

$var1= $row[0];

etc..

}

 

Help! Thx

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.