Re: $query works but i still get a returned error
| From: | PAUL FERRIE | Date: | Thu, 20 Nov 2003 13:36:10 +0000 |
| Subject: | Re: $query works but i still get a returned error | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-170410@lists.php.net to get a copy of this message | ||
So your saying i should be using POST rather than GET?
"John W. Holmes" <holmes072000@charter.net> wrote in message
news:3FBCC031.5090109@charter.net...
> PAUL FERRIE wrote:
>
> > I am not sure what the problem is here. The script runs and deletes the
> > relevent row but still returns "DATA from albums loaded
> > row id 658 did not get sent
> > Error deleting row!
> > Warning: Cannot modify header information - headers already sent by
(output
> > started at /home/pferrie/public_html/vinrev/adm/deleteid.php:2) in
> > /home/pferrie/public_html/vinrev/adm/deleteid.php on line 21
>
> You get this error because you echo display messages and errors before
> trying to do a header() redirect. You can't have any output before
header().
>
> > "
> > <?
> > if (isset($_GET['tablename'])) {
> > echo "DATA from <b>{$_GET['tablename']}</b>
> > loaded<br>";
> > } else {
> > echo "<i>$tablename</i> did not get sent<br>";
> > }
> > if (isset($_GET['id'])) {
>
> Take a look at your form again, you're using POST.
> if(isset($_POST['id'])) {
>
> > echo "row id= <b>{$_GET['id']}</b><br>";
> > } else {
> > echo "row id <i>$id</i> did not get sent<br>";
>
> But you must have register_globals still on because $id is set with the
> same value as $_POST['id']...
>
> > }
> >
> >
> > include("connection.php");
> > $query = mysql_query("DELETE FROM $tablename WHERE id= $id")or
die("<br>ther
>
> and that's why this query works, because $id is the correct value.
>
> > was an error<br> tablename:= $tablename<br>
> > row id:= $id");
> > if(!mysql_query($query)) {
> > echo"Error deleting row!");
> > }
> > Header("Location: delete.php?success=$success");
> >
> > ?>
> >
> >
> > I am php newbie and might be missing the obviuos
>
> Might be missing the obvious, too. ;)
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals www.phparch.com