RE: [PHP] MySQL problem - stumped
| From: | Matt Williams | Date: | Sat, 10 Mar 2001 19:32:39 +0000 |
| Subject: | RE: [PHP] MySQL problem - stumped | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-43335@lists.php.net to get a copy of this message | ||
> > >The following code is giving an me problems, I can't figure it
> > out to save
> > >my soul. The last line gives:
> > >
> > >Here is the code:
> > >
> > >$link = db_connect();
> > >$query = "UPDATE Users SET firstname='$firstname',
> > >lastname='$lastname'
> > >WHERE username='$user' && password='$password'";
> > >$result = mysql_query($query, $link);
> > >$err = mysql_error();
> > >echo "Errors:".$err;
> > >$rows = mysql_affected_rows($result);
> > >
> > >And here is the output:
> > >Errors:
> > >Warning: Supplied argument is not a valid MySQL-Link resource in
> > >/****/*****/****/**********.********.***/db.php on line 147
Hi
OK my thoughts, no disrespect intended.
Is the table Users and not users? Are all the column names correct and are
they really in this tables??
also try
$result = mysql_query($query, $link) or die ($mysql_error())
to see what output mysql is giving as to why the query failed.
As I say no disrespect but you need to go back and try to unsderstand why it
is failing
M@