Re: Re: stupid error, please kick me (and send me a solution)

From: Date: Mon, 03 Jun 2002 22:49:19 +0000
Subject: Re: Re: stupid error, please kick me (and send me a solution)
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-100482@lists.php.net to get a copy of this message
leco@gcsnet.com.br wrote:
Do not use double kotes here. $link_glob = \"mysql_connect(\'$host_glob\', \'$un_glob\', \'$pw_glob\')\"; mysql_connect is a function. Regards, Laercio Fortes Citando Jason Soza <solja@gci.net>:
If this is truly the code you\'re using, you\'re missing the closing curly-brace after the else statement. I.e. this: } else {
     echo \"<font size=+1>Your Information has successfully been entered into the database!</font><br>\";
Should be this: } else {
     echo \"<font size=+1>Your Information has successfully been entered into the database!</font><br>\";
      }
HTH, Jason Soza ----- Original Message ----- From: Jule Slootbeek <jslootbeek@clarku.edu> Date: Monday, June 3, 2002 2:09 pm Subject: 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 href=mailto:$webmaster>webmaster.</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
changing that line to this: $link_glob = mysql_connect("$host_glob", "$un_glob", "$pw_glob"); doesn't make any difference... i still get the error.. could it be my setup? the $link_glob var is in globals.inc.php and i use this through require('globals.inc.php'); which has worked great in the past... the other two lines. Now: $query = "INSERT INTO user values('0', '$fname', '$lname', '$email', '$username', PASSWORD('$password')"; $result = mysql_db_query("$db_glob", "$query", "$link_gob"); are in register_user.php in which the first line is require('globals.inc.php'); I've used this method in the past also, and i've never experienced problems with it... thanks, Jule -- Jule Slootbeek jslootbeek@clarku.edu http://blindtheory.cjb.net

« previous php.general (#100482) next »