on 4/12/02 11:15 PM, Jennifer Downey at [EMAIL PROTECTED] appended the
following bits to my mbox:

> I believe it has something to do with the first while statement's closing
> curly bracket placement
> but I can't seem to get it in the right place.

Hi Jennifer,

The first thing you should do is properly indent your code.  If you do so,
you'll be sure to find the missing bracket.  Basically, for each new block,
tab out again.  It really helps to use a programmer's editor with syntax
highlighting like vim or BBEdit.  Here's an example using your code:


$id = $HTTP_GET_VARS["id"];

$query = "SELECT id, name, image, quantity, type FROM
{$config["prefix"]}_my_items WHERE uid={$session["uid"]} ORDER BY id";
$ret = mysql_query($query);

while($row = mysql_fetch_array($ret)) {

    $iid = $row['id'];
    $image = $row['image'];
    $name = $row['name'];
    $quantity = $row['quantity'];
    $type = $row['type'];

    if ($iid == $id) {

        $display_block ="<CENTER><img src=$image border=0><br><font
        echo "$display_block<BR><BR>";

        if ($type == "food") {
            //if book or weapon is present then set an option and include in
the form later
            $thisoption="<OPTION VALUE=\"feed\">Feed my pet\n</OPTION>";

        } else {

            //if any other type is present then set a blank

        } // end option "if" statement

    } // end id "if" statement

/* More code after this point */

} // end "while" if statement.


Hope that helps.


Paul Burney

    while ($self != "asleep") {

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to