rendered paste body<?php if( mysql_connect() == FALSE ) { echo 'Could not connect: ', mysql_error(); exit; } if( mysql_select_db( ) == FALSE ) { echo 'Unable to select database: ', mysql_error(); exit; } if( ( $result = mysql_query( "SELECT ID, Ad_Name, Image_location FROM elmasweb_advertisment ORDER BY RAND() LIMIT 5" ) ) == FALSE ) { echo 'Query failed: ', mysql_error(); exit; } if( mysql_num_rows( $result ) > 0 ) { while( $row = mysql_fetch_array( $result, MYSQL_ASSOC ) ) { $advertisment = array($row['Image_location']);} } ?>