Jaxon,

do you have a line of white space after your closing tag?

Anyway, this looks fishy to me:

if (!isset($page_id))
        {
        $sql="select page_id from table where fieldname = $value";
        $link_id = mysql_connect($host, $usr, $pass) or die (mysql_error());
        mysql_select_db($database, $link_id); //select database catalog
        $result = mysql_query ($sql, $link_id) or die (mysql_error());
//return result set to php
        if (!$result) echo "wait - no result set!";

        $page_id = mysql_result($result, 0, fieldname);

    // Where is the closing } for if (!isset($page_id))        { ?
    // added it below
        }

I think you'd benefit from using braces more often too, so your style is
consistent..... so changing

if (!$result) echo "wait - no result set!";

to

if (!$result)
{
    echo "wait - no result set!";
}

might mean that you're able to spot things like this more easily.

Just my opinion ;)

James

"Jaxon" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> Can anyone tell me why I have a parse error here?
>
> I'm including this file, which is 16 lines, but the error being thrown by
> the including page reports a parse error in this file on line 17 ???:
> <?php
> if (!isset($page_type))
>         {
>         $page_type = "foo";
>         }
>
> if (!isset($page_id))
>         {
>         $sql="select page_id from table where fieldname = $value";
>         $link_id = mysql_connect($host, $usr, $pass) or die
(mysql_error());
>         mysql_select_db($database, $link_id); //select database catalog
>         $result = mysql_query ($sql, $link_id) or die (mysql_error());
> //return result set to php
>         if (!$result) echo "wait - no result set!";
>
>         $page_id = mysql_result($result, 0, fieldname);
> ?>
>
> cheers,
> jaxon
>



-- 
PHP General 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]

Reply via email to