syntax help
| From: | bob pilly | Date: | Fri, 13 Feb 2004 12:10:06 +0000 |
| Subject: | syntax help | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-177591@lists.php.net to get a copy of this message | ||
Hi all
I have a problem that is probably just a lack of php
syntax knowledge on my part and hopefully someone can
help me out.
I have an array and i want to query a database for
each value in that array. I then want to store that
result as a new variable called $array[value]total.
see code below
$array=array("Flyer","Email","Phone");
$array_len=count($array);
for($i=0;$i<$array_len;$i++){
$query="select count(score) from test_table
where source = '$array[$i]'";
$result=mssql_query($query,$numero);
$row=mssql_fetch_row($result);
$array[$i].total=$row[0];<-- problem here
}
so for the above code i would like to create three
variable $flyertotal,$emailtotal & $phonetotal and
have the result of the count(score) query stored in
them. Any help or pointing to documentation would be
greatly appreciated!
Cheers
Bob
________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html