You are here: Re: PHP/MySql noob falls at first hurdle « PHP « IT news, forums, messages
Re: PHP/MySql noob falls at first hurdle

Posted by Brice on 12/09/05 16:23

On 12/9/05, Paul Jinks <paul@pauljinks.co.uk> wrote:
> Hi all
>
> I've been asked to put simple database interactivity on an academic
> site. They want users to enter a few details of their projects so other
> researchers can search and compare funding etc. How difficult can that
> be, I thought....
>
> I've built the database in MySQL and entered some dummy data, and I'm
> now trying in the first place to get the data to display with a simple
> select query to display the variable "projTitle" from the table
> "project" thus:
>
> <head>
> <snip>
> <?
>
> $SQLquery = "SELECT projTitle FROM project";
> $result = mysql_query($SQLquery)
> or die ("couldn't execute query");
> mysql_close($connect)
>
> ?>
>
> <body>
> <p>Result of <b><?=$SQLquery ?></b></p>
>
> <p>
> <?
> while($ouput_row = mysql_fetch_array($result)) {
> ?>
> <?=$output_row["projTitle"]?><br />
> <?
> }
> ?>
>
> </p>
> </body>

Try to check the key of your result row with a print_r or a var_dump command.

Brice Favre
http://pelmel.org/

 

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

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