If any of the values you are trying to insert are not integers, you need to
put single quotes around the variables, ie. $SCRIPT_NAME, $date, $BName, etc
in the insert statement.
Robby Whiteside <[EMAIL PROTECTED]> said:
> 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 Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]