Does not update, but cannot find why

Does not update, but cannot find why

am 04.02.2007 21:45:39 von Juergen Koenig

Hi

I have two lines in my script on updating a set in a table. The lines are

$query="UPDATE TelefonEmail SET Haus=$haus, Handy=$handy WHERE Nr=$nr";
$dummy=mysql_query($query);

It does not update and I cannot find out why. I have done a
echo $query
and the line looks totally correct. How can I make mysql tell me, why it is
not updating.

Thanks

Jürgen

Re: Does not update, but cannot find why

am 04.02.2007 21:53:27 von Juergen Koenig

Juegen Koenig wrote:

> Hi
>
> I have two lines in my script on updating a set in a table. The lines are
>
> $query="UPDATE TelefonEmail SET Haus=$haus, Handy=$handy WHERE Nr=$nr";
> $dummy=mysql_query($query);
>
> It does not update and I cannot find out why. I have done a
> echo $query
> and the line looks totally correct. How can I make mysql tell me, why it
> is not updating.

Sometimes you are blindfoldet. Just after I send the posting off it fell of
my eyes. the line should be

$query="UPDATE TelefonEmail SET Haus='$haus', Handy='$handy' WHERE Nr=$nr";

and it works.

Jürgen

Re: Does not update, but cannot find why

am 05.02.2007 11:58:51 von Peter

> Sometimes you are blindfoldet. Just after I send the posting off it fell
> of
> my eyes. the line should be
>
> $query="UPDATE TelefonEmail SET Haus='$haus', Handy='$handy' WHERE
> Nr=$nr";

Just a note, in future it might be worth using mysql_error() this would have
pointed to the error.

Re: Does not update, but cannot find why

am 13.02.2007 05:23:38 von lorento

Please note you must escape the ' character using addslashes() or
mysql_real_escape_string() if your server turn off the magic quote.

--
http://www.mastervb.net/phpbooks -- Best PHP Books
http://anagram.mastervb.net -- Anagram Generator

On Feb 5, 5:58 pm, "peter" wrote:
> > Sometimes you are blindfoldet. Just after I send the posting off it fell
> > of
> > my eyes. the line should be
>
> > $query="UPDATE TelefonEmail SET Haus='$haus', Handy='$handy' WHERE
> > Nr=$nr";
>
> Just a note, in future it might be worth using mysql_error() this would have
> pointed to the error.