Re: Need help - past deadline
| From: | Jay Fitzgerald | Date: | Wed, 27 Aug 2003 18:58:22 +0000 |
| Subject: | Re: Need help - past deadline | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-160947@lists.php.net to get a copy of this message | ||
Ok - Thanks to everyone who has helped me so far both on and off-list - I am almost to where i want to be, but i am unable to reach him for further assistance. Can someone tell me where in this code I can add a grey table row seperator (as shown at the bottom)? AND how come only the first seat from my database is being displayed as taken?
$alphabet = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q');
$rowCount = 14;
$totalSeats = 238;
$connection = mysql_connect("localhost","******","*******") or die ("Couldn't make connection.");
$db = mysql_select_db("registration", $connection) or die ("Couldn't select database.");
$sql = "SELECT seat, alias FROM attendees";
$sql_result = mysql_query($sql,$connection) or die("Couldn't execute query.");
$row = mysql_fetch_array($sql_result);
$alias = $row['alias'];
?>
<center>
<table class="seattable" width="650">
<?php
for($i=0; $i<$totalSeats; $i++)
{
$val = $i + 1;
if($i % $rowCount)
{
echo "<td align=\"center\" valign=\"middle\" ";
}
else
{
echo "<tr>";
echo "<td align=\"center\" valign=\"middle\" class=\"rowheader\">";
echo $alphabet[($i / $rowCount)];
echo "</td>";
echo "<td ";
}
if(in_array($val, $row))
{
echo " class=\"closed\"><a class=\"sold\" title=\"SOLD TO $alias\" onMouseOver=\"self.status='SOLD TO ".$alias."'; return true;\" onMouseOut=\"self.status=' '; return true;\">";
echo "{$alias}";
}
else
{
echo " class=\"open\">";
echo "<input type=\"radio\" name=\"seat\" value=\"{$val}\"><font class=\"avail\">{$val}</font>";
}
if($i % $rowCount + 1)
{
echo "</td>";
}
else
{
echo "</td></tr>";
}
}
?>
</table>
</center>
here is what I am wanting to add - I tried placing this in several places in this code so far (top, middle & bottom) but whenever i add it, the output gets totally fudged....
<tr>
<td class="rowspace"> </TD>
<td class="space" colspan="15"> </td>
</tr>
but I also need it to display ALL of the seats that are in the db as being sold and not just the first row...
TIA
Jay
At 12:00 PM 8/26/2003 -0800, you wrote:
[clip]================================================ Jay Fitzgerald, Design Director - Certified Professional Webmaster (CPW-A) - Certified Professional Web Designer (CPWDS-A) - Certified Professional Web Developer (CPWDV-A) - Certified E-Commerce Manager (CECM-A) - Certified Small Business Web Consultant (CWCSB-A) Bayou Internet - http://www.bayou.com Toll Free: 888.30.BAYOU (22968) Vox: 318.338.2034 / Fax: 318.338.2506 E-Mail: jayfitz@bayou.com ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf ================================================[/clip] <?php print $i++; ?> prints out the value of $i as well as incrementing it twice. Did you notice in your code that the <input type="radio" name="seat" value="{one less than...}"> ... {this}</td> HTH, -Michaelif ($i <= 84) { ?> <td align="center" valign="top" class="green"><input type="radio" name="seat" value="<?php print $i++; ?>"><nobr /><font class="avail"><?php print $i++; ?></td> <?php } }} ?>