$handle = mysql_query( 'SELECT * from `SOME_TABLE WHERE SOEMTHING '); if ( ! $handle ) die ( 'SQL error: ' . mysql_error() ); // either this, to get whole row (array) of result $row = mysql_fetch_array( $handle ); //or this, to get one cell $row = mysql_result( .... ); mysql_free_result( $handle ); // frees up data from this query SOME MORE QUERIES; mysql_close(); // closes SQL connection