There might be an easier way to do it, but this should work:

Change your SELECT statement to "SELECT count(*) as c  ....<other criteria
here>"

After $result = @mysql_query($sql,$connection) or die("Couldn't execute
query.");
Do this:
$mycount = mysql_result($result, 0, 'c') ;

$mycount should now be the value held from your count in the SQL statement.

HTH

Sam Masiello
Software Quality Assurance Engineer
Synacor
(716) 853-1362 x289
[EMAIL PROTECTED]

 -----Original Message-----
From:   Jeremy Morano [mailto:[EMAIL PROTECTED]]
Sent:   Monday, August 06, 2001 4:07 PM
To:     [EMAIL PROTECTED]
Subject:        [PHP] get value

hi,,,

can someone tell me how to access the value of count?     please?
----------------------------------------------------------------------------
---------
$db = @mysql_select_db($db_name, $connection) or die("Couldn't select
database.");

$sql = "SELECT count(*)
        FROM $table_name, company
        Where company.uid = user.companyUid and company.company = '$PHP_AUTH_USER'
        ";

$result = @mysql_query($sql,$connection) or die("Couldn't execute query.");
----------------------------------------------------------------------------
----------



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to