On Saturday 15 February 2003 17:05, Michael Eacott wrote:
> <? php
>
> # Show details of BOOKS
>
> # Performing SQL query
>
> $query = "SELECT * FROM `$books` WHERE `title` LIKE '$title' LIMIT 99";
> $result = mysql_query($query) or die("Query failed");
>
> $count = 1; $bookslist = "";
> while ($rowarray = mysql_fetch_array($result, MYSQL_ASSOC))
> {
Your while loop is loop at the wrong place. Look at the HTML source of your
page ...
> $booksid = $rowarray["booksid"];
> $title = $rowarray["title"];
> print '<html>';
> print '<head>';
> print '<meta http-equiv="Content-Language" content="en-us">';
> print '<meta http-equiv="Content-Type" content="text/html;
> charset=windows-1252">';
[snip]
... these are all repeated for each book. Clearly that's not what you want.
> print '<p>Click box get following book retrieved.
Your loop should start here:
> <input
> type="checkbox" name="book[1][$booksid]" value ="ON" ><br>';
You've setup a counter ($count) so make use of it:
<input type="checkbox" name="book[$count][$booksid]" value ="ON" >
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
"Yo baby yo baby yo."
-- Eddie Murphy
*/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php