You are here: Re: [PHP] show a field in php file « PHP « IT news, forums, messages
Re: [PHP] show a field in php file

Posted by vid on 07/18/05 21:43

Thats just executing the query.. you need to use the result set, and
iterate over it...

$rs = mysql_query($query);
while($row=mysql_fetch_array($rs)) {
echo $row[0]; ...

}

stuff like that.


> Hey guys how would i show a filed from a MySQL database in a php file?
> Isnt it this?
> SELECT * FROM `user`
> But that dosent work because it comes out blank :-\
> And I already am connected to the database
> Code:
>
> mysql_connect ('localhost','myaccount','mypass')
> or die ("could not connect to server");
> mysql_select_db ('database')
> or die ("could not connect to database");
>
> $query = "SELECT *
> FROM `user`
> LIMIT 0 , 30";
> mysql_query($query);
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

 

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

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