You are here: Re: Help with displaying MySQL query results « PHP Programming Language « IT news, forums, messages
Re: Help with displaying MySQL query results

Posted by Lloyd Harold on 11/14/07 12:50

The Natural Philosopher <a@b.c> wrote:

> $query="select * from mytable where location ='4'";
> $result=mysql_query($query);
> > Each result should be displayed in it's own paragraph.
> >
> if ($result && ($rows=myql_numrows($result) >0))
> {
> > Each result should be within a link to open a new page (details.php ?)
> > that will retrieve the details for that name.
> >
> for($i=0;$;<$rows;$i++)
> {
> > Ideally, but not essentially, the new page should contain a link back to
> > the previous results.
> >
> $last_id=$__GET['id'];
> $var1=mysql_result($result,'id); // and any other variables you
> want.
> printf("<p><A HREF=Mycode.php?id=%d>id=%d,</A>\r\n",
> $last_id,$var1);
> }
> }

Thanks for your prompt response.

I've tried the code and am seeing this error:

PHP Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /- on
line 25, which is:

for($i=0;$;<$rows;$i++)

 

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

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