Hello bob,

Friday, February 13, 2004, 12:10:06 PM, you wrote:

bp> $array=array("Flyer","Email","Phone");
bp> $array_len=count($array);
bp> for($i=0;$i<$array_len;$i++){
bp>       $query="select count(score) from test_table
bp> where source = '$array[$i]'";
bp>       $result=mssql_query($query,$numero);
bp>       $row=mssql_fetch_row($result);
bp>       $array[$i].total=$row[0];<-- problem here
bp> }

$array[$i]['total'] = $row[0];

Alternatively, you can probably do this too:

$query = "SELECT COUNT(score) AS hits FROM ...";
$result = mssql_query($query, $numero);
$array[$i]['total'] = mssql_result($result, 0, "hits");

Same end result, but saves on processing a bit. This assumes MSSql has
the same functions available as MySQL does (the mssql_result part)

-- 
Best regards,
 Richard                            mailto:[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to