xWastedMindx
Technical User
I'm having trouble with this.
I'm using a tutorial from Here's the link to the tutorial if you'd like to look at it yourself:
Anywhoo.. I believe I have everything correct, but I keep getting parse errors on line 85. Line 85 is the first variable declaration for $color1 = '#CCFFCC';
I don't get it.. so Here's the code I have.
Does anyone see Anything wrong?
<?php
// Begin
echo "<table border='1' align='center' cellpadding='5' cellspacing='0' width='275'>
<tr><td width='160'><b>DVD Name</b></td><td><b>DVD Price</b></td></tr>";
// Define colors for the alternating rows
$color1 = '#CCFFCC';
$color2 = '#BFD8BC';
$row_count = 0;
// Perform the Query
$results = mysql_query("SELECT * FROM dvd('dvdName','dvdPrice')"
or die(mysql_error());
while ($row = mysql_fetch_array($results)) {
$dvdName = $row["dvdName"];
$dvdPrice = $row["dvdPrice"];
// Some sort of equation that makes it work
$row_color = ($row_count % 2) ? $color1 : $color2;
// Table output here
echo "<tr>
<td width="110" bgcolor="$row_color" nowrap>$dvdName</td>
<td bgcolor="$row_color">$dvdPrice</td>
</tr>";
// Adds 1 to the row count
$row_count++;
}
// Close out your table.
echo "</table>";
?>
I'm using a tutorial from Here's the link to the tutorial if you'd like to look at it yourself:
Anywhoo.. I believe I have everything correct, but I keep getting parse errors on line 85. Line 85 is the first variable declaration for $color1 = '#CCFFCC';
I don't get it.. so Here's the code I have.
Does anyone see Anything wrong?
<?php
// Begin
echo "<table border='1' align='center' cellpadding='5' cellspacing='0' width='275'>
<tr><td width='160'><b>DVD Name</b></td><td><b>DVD Price</b></td></tr>";
// Define colors for the alternating rows
$color1 = '#CCFFCC';
$color2 = '#BFD8BC';
$row_count = 0;
// Perform the Query
$results = mysql_query("SELECT * FROM dvd('dvdName','dvdPrice')"
while ($row = mysql_fetch_array($results)) {
$dvdName = $row["dvdName"];
$dvdPrice = $row["dvdPrice"];
// Some sort of equation that makes it work
$row_color = ($row_count % 2) ? $color1 : $color2;
// Table output here
echo "<tr>
<td width="110" bgcolor="$row_color" nowrap>$dvdName</td>
<td bgcolor="$row_color">$dvdPrice</td>
</tr>";
// Adds 1 to the row count
$row_count++;
}
// Close out your table.
echo "</table>";
?>