
April 22nd, 2004, 04:14 AM
|
|
Registered User
|
|
Join Date: Apr 2004
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Mysql SUB question
Im trying to make a question to the database , but i just cant figure out how to make the
syntax complete, Im trying to do the following question,
$query = mysql_db_query("cacheflow", "SELECT SUM(packets WHERE destinationport LIKE $fragac)AS TOTAL ,date FROM blackhole WHERE datetime BETWEEN '2004-04-21 09:00%' and $now GROUP BY time DESC ") or die ("fel frega");
I have the original question that works fine it looks like this,
$query = mysql_db_query("cacheflow", "SELECT SUM(destinationport LIKE $fragac ) AS TOTAL,date FROM blackhole WHERE datetime BETWEEN '2004-04-21 09:00%' and $now GROUP BY time DESC ") or die ("fel frega");
So what i wanted to do is to get the sum out of "packets" where destinationport like $fraga , but something is f*cked up =)
Anyone got a good answer to what i do wrong??
// regards Carl
|