First of all, thanks to everyone who advised me and pointed me in the direction of a MySQL tut on my last post, it has helped enormously.
Just wondering if anyone could help me out on the below:
I have a MySQL table that has data from surveys and is identified by an ID per review.
I'm trying to get the PHP script to calculate the average of 10 columns across th row - is this possibe? The code I'm trying to use is:
but it keeps coming back with a Syntax error on line 1.
$avgtocalc = mysql_real_escape_string($_GET['ad1']);
$average = mysql_query("SELECT * FROM reviewdata WHERE address='$avgtocalc' AND published LIKE 'Live' AVG ('livedthere' + 'parking' + 'crime' + 'noiseneighbours' +
'noisetraffic' + 'distanceshops' + 'distanceschools' + 'conditionpavements' + 'conditionroads' + 'nightlighting')/(10) ") or die(mysql_error());
Does anyone have any ideas? I've Googled this to death but can't find what I need.
Thanks in advance