Re: stupid error, please kick me (and send me a solution)
| From: | Sqlcoders.com Programming Dept | Date: | Tue, 04 Jun 2002 08:09:05 +0000 |
| Subject: | Re: stupid error, please kick me (and send me a solution) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-100477@lists.php.net to get a copy of this message | ||
Hiya,
You're using single quotes around all your strings,
for variables to be replaced with their values, you must use double quotes.
Try replacing every ' with ".
HTH,
Dw
Sqlcoders.com Dynamic data driven web solutions
----- Original Message -----
From: "Jule Slootbeek" <jslootbeek@clarku.edu>
To: "mysql" <mysql@lists.mysql.com>; "php-general"
<php-general@lists.php.net>
Sent: June 03 2002 03:09 PM
Subject: [PHP] stupid error, please kick me (and send me a solution)
> Hey guys,
> i'm getting this error with the following sql script using php:
> --error--
> Warning: Supplied argument is not a valid MySQL-Link resource in
> /var/www/phpquiz/register_user.php on line 12
> --error--
>
> --script--
> $link_glob = "mysql_connect('$host_glob', '$un_glob',
> '$pw_glob')";
> $query = "INSERT INTO user values('0', '$fname', '$lname',
> '$email',
> '$username', PASSWORD('$password')";
> $result = mysql_db_query('$db_glob', '$query', $link_glob');
> if (!$result) {
> echo "<font size=+1>Your Information could not be entered into the
database,
> Please contact the <a
>
> href=mailto:$webmaster>webmaster</a>.</font><br><br>"
> . mysql_errno() .
> ": " . mysql_error() . "<br><br>";
> } else {
> echo "<font size=+1>Your Information has successfully been entered into
the
> database!</font><br>";
>
> --
> Jule Slootbeek
> jslootbeek@clarku.edu
>
> http://blindtheory.cjb.net
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>