Help - Search - Members - Calendar
Full Version: Messed up with php opening tag
Codegrrl.com Forums > Script Help > Tutorial Help
Vlad
It should be simple, but I've got some problems...

CODE
<? include ('connection.php');
$result = "SELECT * FROM chroncile_categories";
echo "Выберите категорию:<br>
<select name='categoy' id='category'>;
while ($row = mysql_fetch_array($result)) { ?>
<option value="<?php echo $row['category_id']; ?> <? echo $row['category_name']; ?>"></option>
<?php
}
?>

</select>


The error mesdage: Parse error: syntax error, unexpected '?' in the line <option value="<?php echo $row['category_id']; ?> <? echo $row['category_name']; ?>"></option>
Please, make me understand which of '?' smile.gif
Jem
You're missing a " at the end of your echo:

CODE
echo "Выберите категорию:<br>
<select name='categoy' id='category'>;


should be:

CODE
echo "Выберите категорию:<br>
<select name='categoy' id='category'>";
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.