RE: [PHP] Need Help - past deadline
Ok - Thanks to Jim Lucas 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? 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=rowspacenbsp;/TD td class=space colspan=15nbsp;/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 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/http://www.bayou.com Toll Free: 888.30.BAYOU (22968) Vox: 318.338.2034 / Fax: 318.338.2506 E-Mail: mailto:[EMAIL PROTECTED][EMAIL PROTECTED] ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf
RE: [PHP] Need Help - past deadline
Ok - Thanks to Jim Lucas 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? 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=rowspacenbsp;/TD td class=space colspan=15nbsp;/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 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: [EMAIL PROTECTED] ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need help - past deadline
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=rowspacenbsp;/TD td class=space colspan=15nbsp;/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] if ($i = 84) { ? td align=center valign=top class=greeninput type=radio name=seat value=?php print $i++; ?nobr /font class=avail?php print $i++; ?/td ?php } } } ? [/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, -Michael 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: [EMAIL PROTECTED] ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Need help - past deadline
Jay Fitzgerald mailto:[EMAIL PROTECTED] on Tuesday, August 26, 2003 10:40 AM said: can someone please look at my code below and tell me why it is only working half-way? It is only displaying radio buttons and seats for numbers 71, 73, 75, 77, 79, 81, 83, and 85.and it is printing seat # 76 since that is the one in the database between seats 81 and 83why is this happenening and HOW can i correct it??? $sql = SELECT seat, alias FROM attendees; $sql_result = mysql_query($sql,$connection) or die(Couldn't execute query.); $row = mysql_fetch_array($sql_result); $myseat = array('70','71','72','73','74','75','76','77','78','79','80','81','82',' 83','84'); $i = 70; foreach ($myseat as $seat) { if (($seat) == ($row[0])) { if ($i = 84) { td align=center valign=top class=reda class=sold onMouseOver=self.status='SOLD TO ?php echo $alias; ?'; return true; onMouseOut=self.status=' '; return true;?php print $row[0]; ?/td ?php } } else { if ($i = 84) { td align=center valign=top class=greeninput type=radio name=seat value=?php print $i++; nobr /font class=avail?php print $i++; ?/td ?php } } } 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/http://www.bayou.com Toll Free: 888.30.BAYOU (22968) Vox: 318.338.2034 / Fax: 318.338.2506 E-Mail: mailto:[EMAIL PROTECTED][EMAIL PROTECTED] ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] need help - past deadline
[snip] $sql = SELECT seat, alias FROM attendees; $sql_result = mysql_query($sql,$connection) or die(Couldn't execute query.); $row = mysql_fetch_array($sql_result); $myseat = array('70','71','72','73','74','75','76','77','78','79','80','81','82',' 83','84'); $i = 70; foreach ($myseat as $seat) { if (($seat) == ($row[0])) [/snip] Jay you are not looping through each row as far as I can see. You fetch the row array once, getting you one seat and one alias. You loop through the $myseat array against the one row, and I think you should loop through the $myseat array for each row...right? Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Need help - past deadline
Jay Fitzgerald mailto:[EMAIL PROTECTED] on Tuesday, August 26, 2003 10:40 AM said: Whoops! Sent that first one prematurely. heh... can someone please look at my code below and tell me why it is only working half-way? What does print_r($row) show you? Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need help - past deadline
On Tue, 26 Aug 2003 12:39:53 -0500, you wrote: td align=center valign=top class=red a class=sold onMouseOver=self.status='SOLD TO ?php echo $alias; ?'; return true; onMouseOut=self.status=' '; return true;?php print $row[0]; ? /td Missing /a 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/http://www.bayou.com Toll Free: 888.30.BAYOU (22968) Vox: 318.338.2034 / Fax: 318.338.2506 E-Mail: mailto:[EMAIL PROTECTED][EMAIL PROTECTED] ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php