You are here: Re: php querying « PHP Programming Language « IT news, forums, messages
Re: php querying

Posted by SrSilveira on 06/04/07 15:59

On Jun 4, 12:36 pm, vinnie <centro.ga...@gmail.com> wrote:
> where is the error in a query performed with php in this script?
>
> <?php
> @ $db=mysql_pconnect('localhost', 'database_name', 'password');
> if (!$db)
> {
> echo 'conneciton eror';
> exit;
> }
> else
> {
> echo 'connection on!';
> }
> mysql_select_db('books'); //books: table created previously.
> $query="select * from orders"; //orders: a table that i have
> previosly created.
> $result=mysql_query($query);
> $num_results=mysql_num_rows($result);
> if ($num_results = 0)
> {
> echo'<br><br>nothing to dispaly';}
>
> else
> {
> echo'<br><br>here are the results: $num_results';}
>
> ?>

wrong: if ($num_results = 0)

right: if ($num_results == 0)

 

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

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