Hy i have this sql query.. how can i combine with the next one ?...
this

    $sql = "select id,date,category,sum(q1) Total,sum(q2) Total2,sum(q3) Total3,sum(q4) Total4,sum(q5) Total5,sum(q6) Total6 from articles group by category order by id";

with

$sql = "SELECT * FROM articles WHERE from_date >= '".mysql_real_escape_string($_REQUEST["from"])."' AND to_date <= '".mysql_real_escape_string($_REQUEST["to"])."'".$search_string.$search_city;

as a mare a fact i what to use this

'".mysql_real_escape_string($_REQUEST["from"])."' AND to_date <= '".mysql_real_escape_string($_REQUEST["to"])."

in my sql query...it is possible?

I have changed your first query
1) added 2 columns in group by
2) added where clause according to your second query

$sql = "select id,date,category,sum(q1) Total,sum(q2) Total2,sum(q3) Total3,sum(q4) Total4,sum(q5) Total5,sum(q6) Total6 from articles WHERE from_date >= '".mysql_real_escape_string($_REQUEST["from"])."' AND to_date <= '".mysql_real_escape_string($_REQUEST["to"])."'".$search_string.$search_city."  group by category order by id, date,category ";
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.