Re: Error(Newbie)

From: Date: Sun, 23 Jun 2002 01:10:16 +0000
Subject: Re: Error(Newbie)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-103438@lists.php.net to get a copy of this message
>$query = "INSERT INTO stats >(vid, id, >vn, time, >host, referrer, >browser) VALUES ('', '$id', '$_COOKIE >['tececo_stats']', '$time', >'$_SERVER['REMOTE_HOST']', '$_SERVER['HTTP_REFERER']', >'$_SERVER >['HTTP_USER_AGENT']'); "; Try using $_COOKIE[tececo_stats] instead...without the single quotes (for the other vars, too). You don't need all of those backticks in your query, either... ---John Holmes... ----- Original Message ----- From: webmaster@tececo.com To: php-general@lists.php.net Sent: Saturday, June 22, 2002 10:19 AM Subject: [PHP] Error(Newbie) Both the below are in the same dir. The meta.array_create.php file works fine elsewhere when I try and view stat.php I get this error: Parse error: parse error, expecting T_STRING' or T_VARIABLE' or `T_NUM_STRING' in C:\TecEco(Converting To PHP)\includes\stat.php on line 7 What does the error mean and how can I correct my code? File meta.array_create.php ----------------------------------- <? $fn = explode("/", $_SERVER['PHP_SELF']); $num_of_s = count($fn) - 1; $fn = "$fn[$num_of_s]"; $query = "SELECT * FROM meta_data WHERE page_name = '$fn'"; $result = mysql_query($query); $num_results = mysql_num_rows($result); $row = mysql_fetch_array($result); $id = $row['id']; $pid = $row['pid']; $title = $row['title']; $description = $row['description']; $keywords = $row['keywords']; ?> file stat.php ------------------------- <? include "meta.array_create.php"; if(!isset($_COOKIE['tececo_stats'])) { setcookie ("tececo_stats", 1); } $query = "INSERT INTO stats (vid, id, vn, time, host, referrer, browser) VALUES ('', '$id', '$_COOKIE['tececo_stats']', '$time', '$_SERVER['REMOTE_HOST']', '$_SERVER['HTTP_REFERER']', '$_SERVER['HTTP_USER_AGENT']'); "; $insert = mysql_query($query); ?> ------------------------------------------------------------------------------ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#103438) next »