Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Very Grateful
April 16, 2014, 11:27 pm
rate this thread
I'm getting this error on a lot of the pages on my site:
Parse error: syntax error, unexpected '$sql' (T_VARIABLE) in
/home/company/public_html/pages/job-postings/index.php on line 7
this is the snippet of code i think the above error message refers to:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml ">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
$sql = "SELECT * FROM cms_pages WHERE page_name='$PHP_SELF'";
$result = mysql_query($sql);
$page = mysql_fetch_array($result);
<title><? echo $page[page_title]; ?></title>
Thanks for reading and considering
Re: PHP Parse error: syntax error, unexpected '$sql' (T_VARIABLE) in
You have a character 'd' following the end-of-statement marker ';'
PHP reads this 'd' as the start of the next statement, which continues with
the $sql of the statement below
d $sql = "SELECT * FROM cms_pages WHERE page_name='$PHP_SELF'";
is a syntax error. PHP was not expecting a variable ($sql) to follow the 'd'
token, and told you so.
To fix it, remove the 'd' from after the semi-colon on the include_once line
"In Skills, We Trust"
PGP public key available upon request