How to obtain the SUM () value of SQL? Urgent! Online, etc! I have a table named "test1". The field name "num" has three fields: 111222333 $ SQL = mysql_query (& quot; selectSUM (num) fromtest1 & quot ;); $ a = xxx ($ SQL); which function xxx should be used next? how can I obtain the SUM () value of SQL by setting the value of 666? Urgent! Online, etc! I am a Thai food
There is a table test1
Field name num
There are three fields 111 222 333
$ SQL = mysql_query ("select SUM (num) from test1 ");
$ A = xxx ($ SQL );
Which function xxx should be used to obtain the number 666 and assign it to the variable ???
Very grateful
------ Solution --------------------
SQL = mysql_query ("select SUM (num) as t_sum from test1 ");
$ Res = mysql_fetch_array ()
Echo $ res [t_sum]
------ Solution --------------------
$ A = mysql_fetch_array ($ SQL );
Echo"
";
Print_r ($ );
Echo"
";
------ Solution --------------------
SQL = mysql_query ("select SUM (num) as sum from test1 ");
$ Res = mysql_fetch_array ()
Echo $ res [sum]