Re: Checkboxes to gather rows to delete

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> I think the problem is that I need to put the array into a comma delimited
> group....
> Lewis

Ummmm... that's what IMPLODE does. It will take the array and turn it into a
comma separated list. Your having a problem because you're not passing an
array when you think you are.

---John Holmes...

> ----- Original Message -----
> From: "John W. Holmes" <holmes072000@charter.net>
> To: "'Lewis Watson'" <php@visionsix.com>; <php-db@lists.php.net>
> Sent: Monday, February 24, 2003 11:09 AM
> Subject: RE:  Checkboxes to gather rows to delete
>
>
> > > Hi there,
> > > I have double checked the column names....Its giving me a Warning: Bad
> > > arguments to implode() error....
> > > Thanks.
> > > Lewis
> >
> > What's the code you're using? Are you sure $deleteID is an array at the
> > point you call implode()? Are you sure it's available in the current
> > scope at the point you call implode()?
> >
> > ---John W. Holmes...
> >
> > PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> > today. http://www.phparch.com/
> >
> > >
> > > ----- Original Message -----
> > > From: "1LT John W. Holmes" <holmes072000@charter.net>
> > > To: "Lewis Watson" <php@visionsix.com>; <php-db@lists.php.net>
> > > Sent: Monday, February 24, 2003 10:36 AM
> > > Subject: Re:  Checkboxes to gather rows to delete
> > >
> > >
> > > > > Thanks..... The below code returns each ID in an array like so...
> > > > > Array ( [0] =>101 [1] => 201 ). Thanks for the help!
> > > > > Lewis
> > > > >
> > > > > $teacherID = $_POST[teacherID];
> > > > > $deleteID = $_POST[deleteID];
> > > > >
> > > > > if(isset($delete_teacher)) {
> > > > >       This is where I should loop through checking for the chosen
> > ones
> > > to
> > > > > delete.....
> > > >
> > > > $query = "DELETE FROM table WHERE teacherID IN (" .
> > > implode(',',$deleteID) .
> > > > ")";
> > > > mysql_query($query);
> > > >
> > > > >     }
> > > > >
> > > > > <form action="" method="POST">
> > > > >  print "<input type=checkbox name=\"deleteID[]\"
> > > > > value=\"$row[teacherID]\">";
> > > > >  print "<input type=submit  name=\"delete_teacher\"
> > value=\"Delete
> > > the
> > > > > Checked Teachers\">";
> > > >
> > > > Make sure the column names are correct, but that's it.
> > > >
> > > > ---John Holmes...
> > > >
> > > >
> > >
> > >
> > > --
> > > PHP Database Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux