A
AndyBlack
- Original Poster
- #1
Hi,
Just wondered if any of you php wizards would take a look at the following code for me. It is coming back with an error. Can I have a while loop within an isset {} statement?
The error i'm getting is..........
Parse error: syntax error, unexpected '{' in /home/awp/public_html/process-categories.php on line 62
The full php segment is......
<?php
# View content script
if (isset($_POST['view'])) {
include 'config.php';
$category = $_POST['contentdata'];
$memberid = $_POST['loggedid'];
$projcat = $_POST['thesite'];
echo "<p class='greentitle'>Content For Topic : ".$category."</p>";
echo "<table width='506' height='56' border='0' align='center'>";
$query = mysql_query("SELECT * FROM content WHERE category LIKE '".$category."' AND memberid LIKE '".$memberid."'");
while ($row = (mysql_fetch_array($query)) {
$content = $row['content'];
$theid = $row['id'];
echo "<tr>";
echo "<td width='372'><label>";
echo "<textarea name='contentdata' cols='45' rows='7' value='".$content."'></textarea>";
echo "</label></td>";
echo "<td width='64'><input type='submit' name='update' value='Update!!' /></td>";
echo "<td width='56'><label>";
echo "<input type='submit' name='delete' value='Delete!' />";
echo "</label></td>";
echo "</tr>"; }
echo "</table>"; }
?>
The red text is line 61.
If any of you guys can advise me on this, it would be much appreciated.
Thanks!
Andy
Just wondered if any of you php wizards would take a look at the following code for me. It is coming back with an error. Can I have a while loop within an isset {} statement?
The error i'm getting is..........
Parse error: syntax error, unexpected '{' in /home/awp/public_html/process-categories.php on line 62
The full php segment is......
<?php
# View content script
if (isset($_POST['view'])) {
include 'config.php';
$category = $_POST['contentdata'];
$memberid = $_POST['loggedid'];
$projcat = $_POST['thesite'];
echo "<p class='greentitle'>Content For Topic : ".$category."</p>";
echo "<table width='506' height='56' border='0' align='center'>";
$query = mysql_query("SELECT * FROM content WHERE category LIKE '".$category."' AND memberid LIKE '".$memberid."'");
while ($row = (mysql_fetch_array($query)) {
$content = $row['content'];
$theid = $row['id'];
echo "<tr>";
echo "<td width='372'><label>";
echo "<textarea name='contentdata' cols='45' rows='7' value='".$content."'></textarea>";
echo "</label></td>";
echo "<td width='64'><input type='submit' name='update' value='Update!!' /></td>";
echo "<td width='56'><label>";
echo "<input type='submit' name='delete' value='Delete!' />";
echo "</label></td>";
echo "</tr>"; }
echo "</table>"; }
?>
The red text is line 61.
If any of you guys can advise me on this, it would be much appreciated.
Thanks!
Andy