You are here: Re: [PHP] retrieve single field from database without while loop « PHP « IT news, forums, messages
Re: [PHP] retrieve single field from database without while loop

Posted by Tom Rogers on 10/03/73 11:08

Hi,

Wednesday, February 16, 2005, 9:48:41 PM, you wrote:
rac> Is there a way to retrieve and display a single value (customer number) from
rac> a database and display it without using

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


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


rac> Thanks in advance,

rac> Ross


You can just drop the while
$row = mysql_fetch_array($result);

if you only have one row and one column you can do:

$var = mysql_result($result,0,0);

--
regards,
Tom

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация