No information is displayed (there are no errors either), although the table is not non-empty.

ini_set('display_errors', 'On'); $conn = mysql_connect ("localhost","root",""); mysql_select_db("lol13",$conn); $sql = mysql_query("SELECT SUM('sumer') FROM 'out' WHERE 'idu'='$udi'"); echo $sql; 

1 answer 1

If you read the documentation you will find the following lines:

The resulting result descriptor must be passed to the mysql_fetch_assoc () function or any other function that works with the results of the queries.

For example, if you want to get a result, you should do the following:

 $sql = mysql_query("SELECT SUM('sumer') as `total` FROM 'out' WHERE 'idu'='$udi'"); $result = mysql_query($sql); $values = mysql_fetch_assoc($result); echo $values['total'];