Jump to content

[SOLVED] Is this part of the script code or ????


kdreg

Recommended Posts

Hi,

 

I'm trying to follow along in a tutorial, but I don't recognize part of it (sorry, I can't post in code... this forum doesn't maintain my cookies or allow me to do any text options):

 

 

$result = mysql_query('SELECT category_id,category_name FROM gallery_category');

while($row = mysql_fetch_array($result)) {

  $photo_category_list .= <<<__HTML_END

<option value="$row[0]">$row[1]</option>\n

__HTML_END;

}

mysql_free_result( $result );

 

 

 

this part:

  $photo_category_list .= <<<__HTML_END

 

is throwing up this error:

 

Parse error: syntax error, unexpected T_SL in /home/something/public_html/preupload.php on line 15

 

should the ___HTML_END not be there? I've never encountered an unexpected T_SL error before, or <<< for that matter.

 

Thank you for any assistance.

 

 

 

 

 

 

Link to comment
Share on other sites

try renaming both cases of __HTML_END to something like CODE it doesnt really matter what aslong as there both the same.

 

  $photo_category_list .= <<<__HTML_END

<option value="$row[0]">$row[1]</option>\n

__HTML_END;

thats just another way to store html.

Link to comment
Share on other sites

Thank you, Renlok. It actually turned out to be in this case that there was a space after the HTML_END and that was causing the problem. Well, that's interesting, about that being another way to store html. It really threw me! Thanks again...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.