RE: retrieve single field from database without while loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip]
Is there a way to retrieve and display a single value (customer number)
from 
a database and display it without using

while ($row = mysql_fetch_array) ($result)){


I have a value I know the query will only ever return a single value. I
want 
to get it from the database and convert it to a variable so I can use it
on 
my php page.
[/snip]

Yes...take out the while....

$row = mysql_fetch_array($results);
echo $row['CustomerNumber'] . '\n';

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux