Re: [PHP] stupid error, please kick me (and send me a solution)
Please note that this only neccesarily applies to MySQL. I've run into a lot of problems by assuming double-quote syntax with postgres and mssql. A better solution is to stop writing your own queries and use an abstraction library. Cheers, Brad Sqlcoders.com Programming Dept wrote: >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" <[EMAIL PROTECTED]> >To: "mysql" <[EMAIL PROTECTED]>; "php-general" ><[EMAIL PROTECTED]> >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 "Your Information could not be entered into the >> >> >database, > > >>Please contact the >href=mailto:$webmaster>webmaster." . mysql_errno() . >>": " . mysql_error() . ""; >>} else { >>echo "Your Information has successfully been entered into >> >> >the > > >>database!"; >> >>-- >>Jule Slootbeek >>[EMAIL PROTECTED] >> >>http://blindtheory.cjb.net >> >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php >> >> >> >> > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] stupid error, please kick me (and send me a solution)
try this jule.. $link_glob = "mysql_connect('$host_glob', '$un_glob', '$pw_glob')"; $temp= PASSWORD($password); $query = "INSERT INTO user values('0', '$fname', '$lname', '$email', '$username', '$temp');"; i think this will work..=) i hope ive done something. - Original Message - From: "Jule Slootbeek" <[EMAIL PROTECTED]> To: "mysql" <[EMAIL PROTECTED]>; "php-general" <[EMAIL PROTECTED]> Sent: Tuesday, June 04, 2002 6:09 AM 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 "Your Information could not be entered into the database, > Please contact the href=mailto:$webmaster>webmaster." . mysql_errno() . > ": " . mysql_error() . ""; > } else { > echo "Your Information has successfully been entered into the > database!"; > > -- > Jule Slootbeek > [EMAIL PROTECTED] > > http://blindtheory.cjb.net > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.360 / Virus Database: 199 - Release Date: 5/7/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] stupid error, please kick me (and send me a solution)
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" <[EMAIL PROTECTED]> To: "mysql" <[EMAIL PROTECTED]>; "php-general" <[EMAIL PROTECTED]> 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 "Your Information could not be entered into the database, > Please contact the href=mailto:$webmaster>webmaster." . mysql_errno() . > ": " . mysql_error() . ""; > } else { > echo "Your Information has successfully been entered into the > database!"; > > -- > Jule Slootbeek > [EMAIL PROTECTED] > > http://blindtheory.cjb.net > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[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 "Your Information could not be entered into the database, Please contact the mailto:$webmaster>webmaster." . mysql_errno() . ": " . mysql_error() . ""; } else { echo "Your Information has successfully been entered into the database!"; -- Jule Slootbeek [EMAIL PROTECTED] http://blindtheory.cjb.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php