You are here: Re: Populating form from database, then passing results to next page « PHP Programming Language « IT news, forums, messages
Re: Populating form from database, then passing results to next page

Posted by Geoff Berrow on 04/06/06 10:43

Message-ID: <1144283421.2806.13.camel@localhost.localdomain> from Scott
contained the following:

>> $query = ("SELECT * FROM `table`");
>> $result = mysql_query($query);
>>
>> print "<p>Data for Selections:";
>> print "<table border=2><tr><th>You chose:";
>>
>
>Try this instead (notice the quotes around array keys):
>
>while($row = mysql_fetch_array($result)) {
> if(in_array(strval($row['ID']), $_POST['subm'])) {

Alternatively, just get the rows you want from the database.

$ids=implode(",",$_POST['subm']);
$query = ("SELECT * FROM `table` WHERE `ID` IN ($ids)");
$result = mysql_query($query);
while($row = mysql_fetch_array($result)) {
//print rows
}
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/

 

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

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