Forgive me if I'm treating pseudo as real but surely 
        print "<tr><td ...  value='$cancel[$or]' ... </td>";
should be
        print "<tr><td ...  value='{$cancel[$or]}' ... </td>";

same goes for the array element in the sql statement

Tim Ward
Internet chess <> 

        From:  Michael Romagnoli [SMTP:[EMAIL PROTECTED]]
        Sent:  22 February 2002 12:21
        To:  [EMAIL PROTECTED]
        Subject:  Re: [PHP] overwriting PHP_SELF and PHP_AUTH_xxxx

        I have a special set of information retrieved from a while loop that
I would
        like a person to be able to edit and send back into a MySQL table.

        I know all of the basic MySQL commands for doing such, but the PHP
side to
        get the input from the form to go in is really stumping me.

        This is what I have:


        $or = 0;

        while($or < $orderidrows) {

        $orderinfo = mysql_fetch_row($orderidinfo);
        $domain[$or] = $orderinfo[2];
        $cancel[$or] = $orderinfo[3];

        print "<tr><td><font size=2 face=Arial>
        size=2 face=Arial>Cancel This Domain?</font></td><td><font size=2
        face=Arial><input type=text name=confirm value='$cancel[$or]'



        The values/data I would normally insert into the MySQL from the form
would be
        $confirm, based on $domain - however, in this case, I have a number
of rows
        with the same
        name. I've received help as far as distinguishing one row from
another -
        thanks.  :)

        The problem I am really having is trying to insert the data back
into one
        particular table.  You see, when I select the data, I get multiple
        orderid's with multiple domains attached to them.  When I try to
        MySQL with the data, only the last orderid seems to be the one
        updated.  And, to boot, I want to update based on the domain name
        that is unique) and ignore the orderids.  I only used the orderids
to pull
        the data out.

        So, I've been using a query like this in a loop;

        $update = "UPDATE table2 SET cancel='$cancel[$a]' WHERE domain =

        Any suggestions?  I'm getting pretty desparate here!  :\



PHP General Mailing List (
To unsubscribe, visit:

Reply via email to