When you write the SQL statement write it as:
select count(user) AS count from log_request where date='$date' and
status = 'open'
(note i have added 'AS count' in there so it stores the value in
Now when you output the result write it as $line->count
"Chris Grigor" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
some of you might laugh at this but I cant get this to work....
Im doing a count on a field and want to diplay the result here is an
mysql_connect("servername", "user", "password")
or die("Connect failed");
$query = "select count(user) from log_request where date='$date' and
status = 'open'";
$result = mysql_db_query("call_manage", "$query")
or die("query failed");
while($line = mysql_fetch_object($result))
print ("<table width=100% border=0><td><tr bgcolor=#f0f0f0>");
print ("<br><b> </b>$line->user<br>\n");
what am I missing as it returns no value at all from $line->user, should I
doing this differently??
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php