Re: HELP PLEASE!! Get query error when inserting into MySql

From: Date: Sat, 27 Oct 2001 13:25:00 +0000
Subject: Re: HELP PLEASE!! Get query error when inserting into MySql
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-72560@lists.php.net to get a copy of this message
What if you single quotes like this: '$REMOTE_ADDR' ??? ----- Original Message ----- From: <robby@thedatasource.net> To: <php-general@lists.php.net> Sent: Saturday, October 27, 2001 3:20 PM Subject: [PHP] HELP PLEASE!! Get query error when inserting into MySql > Hi There, > > I have a query whenever I try to insert something into a mysql table. This is > the code I am using: > <? > > $host1 = gethostbyaddr("$REMOTE_ADDR"); > $date = date("Y-m-d h:i:s"); > $link = mysql_connect("$host", "$user", "$passwd"); > mysql_select_db("$database", $link); > $sql = "INSERT INTO vcstats VALUES('', $SCRIPT_NAME, $date, $HTTP_USER_AGENT, > $BName, $BVersion, $BPlatform, $REMOTE_ADDR, $host1)"; > $result = mysql_query($sql) or die("query error<Br>" . mysql_error()); > mysql_close(); > > ?> > > Thanks, > Robby > > --------------------------------------------- > This message was sent using Endymion MailMan. > http://www.endymion.com/products/mailman/ > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#72560) next »