Does not update, but cannot find why

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
Juergen Koenig [ So, 04 Februar 2007 21:45 ] [ ID #1618321 ]

Re: Does not update, but cannot find why

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
Juergen Koenig [ So, 04 Februar 2007 21:53 ] [ ID #1618323 ]

Re: Does not update, but cannot find why

> 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.
Peter [ Mo, 05 Februar 2007 11:58 ] [ ID #1619398 ]

Re: Does not update, but cannot find why

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" <sub... [at] flexiwebhost.com> 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.
lorento [ Di, 13 Februar 2007 05:23 ] [ ID #1628073 ]
PHP » alt.php.sql » Does not update, but cannot find why

Vorheriges Thema: wampserver 5 not allowing service to mySQL_Admin
Nächstes Thema: wampserver5 cant make work