Parse Error

He has: 1,380 posts

Joined: Feb 2002

Hey...

I'm getting a parse-error, but I can't seem to find it...it says Line 18 of my file, which is

<?php
$header
= stripslashes($qry['header']);
?>

You don't see anything wrong with that, do you?

GAH

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

look up a couple and down a couple of lines from the reported error. Wink

He has: 1,380 posts

Joined: Feb 2002

tried....heres the lines around it:

<?php
/* Get today's date */
$today = date(\"Y\");

/* Connect to database */
$dbh = mysql_connect (\"localhost\", \"username\", \"pass) or die('Database failure: ' . mysql_error());
$dbh2 = mysql_select_db (\"database\");

/* Select table */
$table = strtolower($title);

/* Find data */
$sql = mysql_query(\"SELECT header, body FROM $table\") or die(mysql_error());
$qry = mysql_fetch_array($sql)

/* Grab data */
$header = stripslashes($qry['header']);
$body = stripslashes($qry['body']);
?>

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Look at the code coloured by the forum... Wink You're missing a double quote around "pass".

Busy's picture

He has: 6,151 posts

Joined: May 2001

Isn't header a reserved word?

He has: 1,380 posts

Joined: Feb 2002

As to the missing quote...thats when i changed the correct password to "password". My fault.

I dont know about header...i'll try something else

He has: 1,380 posts

Joined: Feb 2002

Found it...it was a missing ";" about 3 lines above the $header part

Thanks

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.