Hi there. I keep receiving a parse error at the while statement in the program below. I ca'nt figure it out!. Please help??
Sharon
<?
if($radiogo =="update")
{
print $stores;
}
elseif($radiogo =="viewall")
{
$query= "SELECT * FROM shiplist WHERE quantity > 0 AND store = '$stores' ORDER BY date";
$result= mysql_query($query) or print(mysql_error());
$getstorearray=mysql_fetch_array($result, MYSQL_ASSOC) or print(mysql_error());
echo "<p align='center'><font size='4'>Shipped Log: Store $stores</font></p>";
print "<br>";
while ($row= mysql_fetch_array($getstorearray));
{ extract($row);
PRINT<<<END
<table border="1" width="75%" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="20%">$date</td>
<td width="35%">$item</td>
<td width="5%">$quantity</td>
<td width="15%">$enteredby</td>
</tr>
</table>
END;
}
}
?>
parse error
Moderator: General Moderators
Hi there. Thanks for the response. I removed the ; and now I'm getting a parse error on another line which I thnk may be at the bottom of the program. Do you seen anything?
SHaron
<?
if($radiogo =="update")
{
print $stores;
}
elseif($radiogo =="viewall")
{
$query= "SELECT * FROM shiplist WHERE quantity > 0 AND store = '$stores' ORDER BY date";
$result= mysql_query($query) or print(mysql_error());
$getstorearray=mysql_fetch_array($result, MYSQL_ASSOC) or print(mysql_error());
echo "<p align='center'><font size='4'>Shipped Log: Store $stores</font></p>";
print "<br>";
while ($row= mysql_fetch_array($getstorearray)){
extract($row);
PRINT<<<END
<table border="1" width="75%" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="20%">$date</td>
<td width="35%">$item</td>
<td width="5%">$quantity</td>
<td width="15%">$enteredby</td>
</tr>
</table>
END;
}
}
?>
SHaron
<?
if($radiogo =="update")
{
print $stores;
}
elseif($radiogo =="viewall")
{
$query= "SELECT * FROM shiplist WHERE quantity > 0 AND store = '$stores' ORDER BY date";
$result= mysql_query($query) or print(mysql_error());
$getstorearray=mysql_fetch_array($result, MYSQL_ASSOC) or print(mysql_error());
echo "<p align='center'><font size='4'>Shipped Log: Store $stores</font></p>";
print "<br>";
while ($row= mysql_fetch_array($getstorearray)){
extract($row);
PRINT<<<END
<table border="1" width="75%" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="20%">$date</td>
<td width="35%">$item</td>
<td width="5%">$quantity</td>
<td width="15%">$enteredby</td>
</tr>
</table>
END;
}
}
?>
<table border="1" width="75%" cellpadding="0" cellspacing="0" align="center">
you cant have that set-up within a php tag (the <? and ?>)
<table border=1 width=75% cellpadding=0 cellspacking=0 align=center>
or end the php before it and start a new <? to continue with the php code.
or:
<table border=\"1\" cellpadding=\"0\" and so forth, u get the idea.
you cant have that set-up within a php tag (the <? and ?>)
<table border=1 width=75% cellpadding=0 cellspacking=0 align=center>
or end the php before it and start a new <? to continue with the php code.
or:
<table border=\"1\" cellpadding=\"0\" and so forth, u get the idea.
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
It's in a HEREDOC block so it should be ok as is. It would probably be easier to read if it was intim wrote:<table border="1" width="75%" cellpadding="0" cellspacing="0" align="center">
you cant have that set-up within a php tag (the <? and ?>)
<table border=1 width=75% cellpadding=0 cellspacking=0 align=center>
or end the php before it and start a new <? to continue with the php code.
or:
<table border="1" cellpadding="0" and so forth, u get the idea.
Code: Select all
Mac
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
For mac since he's too lazy to copy and paste 
If i see something i'll respond again..
Code: Select all
<?
if($radiogo =="update")
{
print $stores;
}
elseif($radiogo =="viewall")
{
$query= "SELECT * FROM shiplist WHERE quantity > 0 AND store = '$stores' ORDER BY date";
$result= mysql_query($query) or print(mysql_error());
$getstorearray=mysql_fetch_array($result, MYSQL_ASSOC) or print(mysql_error());
echo "<p align='center'><font size='4'>Shipped Log: Store $stores</font></p>";
print "<br>";
while ($row= mysql_fetch_array($getstorearray)){
extract($row);
PRINT<<<END
<table border="1" width="75%" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="20%">$date</td>
<td width="35%">$item</td>
<td width="5%">$quantity</td>
<td width="15%">$enteredby</td>
</tr>
</table>
END;
}
}
?>