Hi

you need quotes around the values

mysql_query("insert into tblquotehits
(qoption,referer,browser,remoteaddr,dt) values
('$quotetype','$referer','$browser','$remoteaddress','$currentdtstring')",$d
b);

HTH

Peter
-----------------------------------------------
Excellence in internet and open source software
-----------------------------------------------
Sunmaia
Birmingham
UK
www.sunmaia.net
tel. 0121-242-1473
International +44-121-242-1473
-----------------------------------------------

-----Original Message-----
From: Bill Arbuckle, Jr. [mailto:[EMAIL PROTECTED]]
Sent: 28 November 2002 22:56
To: [EMAIL PROTECTED]
Subject: [PHP-DB] mysql problem


Hello all!  I am new to php and I am trying to update a mySQL table using
php v4.2.3 for Windows.  I am using the command:

mysql_query("insert into tblquotehits
(qoption,referer,browser,remoteaddr,dt) values
($quotetype,$referer,$browser,$remoteaddress,$currentdtstring)",$db);

I have read the documentation and found some notes on the topic but none
seemed to solve my problem.  I have tried other variations of the command
such as inserting a semicolon at the end of the insert statement before the
closing double quotes.  All variables are defined and all columns are
actually columns in the table ... I have checked all of this.  I have also
returned the result to a variable and echoed it to the screen ... the result
printed is "Resource id #2".

This is driving me crazy as I know it must be something quite simple that I
am overlooking.  Any help is greatly appreciated!  TIA

Bill


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to