$sql = "SELECT campo1,campo2 FROM tabla WHERE condicion "; $result = mysql_query($sql); if ($row = mysql_fetch_array($result)) { echo $row[campo1]; }