function query($select, $from, $where){
db_connect();
$sql = sprintf("SELECT * FROM `%s`
WHERE %s",
mysql_real_escape_string($select),
$from,
$where);
$query = mysql_query($sql);
while ($result = mysql_fetch_assoc ($query)){
$row = $result;
}
return $row;
}