List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:June 4 2002 12:14am
Subject:Re: stupid error, please kick me (and send me a solution)
View as plain text  
At 18:09 -0400 6/3/02, Jule Slootbeek wrote:
>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')";

Why is your mysql_connect() call enclosed within quotes?
All you're doing here is assigning a string to $link_glob.
The script can't possibly work.

Note, too, that even if you take out the quotes, you don't check
the return value from mysql_connect(), so you'll never find out if
it fails.

>$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@stripped
>http://blindtheory.cjb.net
>

Thread
stupid error, please kick me (and send me a solution)Jule Slootbeek3 Jun
  • Re: stupid error, please kick me (and send me a solution)Bruce Lewis4 Jun
    • RE: stupid error, please kick me (and send me a solution)G r e g   L a w r i e4 Jun
      • Re: stupid error, please kick me (and send me a solution)Jule Slootbeek4 Jun
      • Re: stupid error, please kick me (and send me a solution)Jule Slootbeek4 Jun
      • Re: stupid error, please kick me (and send me a solution)Jule Slootbeek4 Jun
        • Re: [PHP] Re: stupid error, please kick me (and send me a solution)Philip Olson4 Jun
          • Re: [PHP] Re: stupid error, please kick me (and send me a solution)Jule Slootbeek4 Jun
            • Re: [PHP] Re: stupid error, please kick me (and send me a solution)Benjamin Pflugmann4 Jun
  • Re: stupid error, please kick me (and send me a solution)Paul DuBois4 Jun
  • Re: [PHP] stupid error, please kick me (and send me a solution)Lejanson C. Go4 Jun
RE: stupid error, please kick me (and send me a solution)domi4 Jun
  • Re: stupid error, please kick me (and send me a solution)Jule Slootbeek4 Jun
  • Re: stupid error, please kick me (and send me a solution)Jule Slootbeek4 Jun
  • Re: stupid error, please kick me (and send me a solution)David M. Peak4 Jun