Display SQL query results in php
I'm tring to diplay results in php from sql database MySQL statement is correct and does what i want in phpMyAdmin but for some reason my code breaks in the webpage here is the code require_once('db.php'); $sql="SELECT * FROM modul1open WHERE idM1O>=(SELECT FLOOR( MAX( idM1O ) * RAND( ) ) FROM modul1open) ORDER BY idM1O LIMIT 1" $result = mysql_query($sql); echo [$result]; and here is what i get In general I need random number limited from min to max by the table id You need to fetch the data from each row of the resultset obtained from the query. You can use mysql_fetch_array() for this. //