php - Mysql query returning resource id #8 instead of desired value -



php - Mysql query returning resource id #8 instead of desired value -

hi trying find how prepare query homecoming right result. here query:

$selectshoeratingquery = "select cast(round(avg(rating)*2)/ 2 decimal(10,1)) rating shoe_id = '$_get[id]'"; $shoerating = mysql_query($selectshoeratingquery);

the query should homecoming number 1 decimal place (3.5). works fine when testing in phpmyadmin, on site returns resource id #8.

the database connection works fine.

mysql_query returns resource. need row it:

$query = mysql_query($selectshoeratingquery); $row = mysql_fetch_row($query); $shoerating = $row[0];

and, unless have no selection - don't utilize mysql_ set of extensions! they're deprecated, , pdo et. al. better. , query vulnerable.

php mysql

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -