Professional Web Applications Themes

[PHP] Need help - past deadline - PHP Development

Jay Fitzgerald <mailto:jayfitzbayou.com> 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 > 83....why 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."); > ...

  1. #1

    Default RE: [PHP] Need help - past deadline

    Jay Fitzgerald <mailto:jayfitzbayou.com>
    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
    > 83....why 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="red"><a 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="green"><input 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/>[url]http://www.bayou.com[/url]
    > Toll Free: 888.30.BAYOU (22968)
    > Vox: 318.338.2034 / Fax: 318.338.2506
    > E-Mail: <mailto:jayfitzbayou.com>jayfitzbayou.com
    > ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf
    > ================================================
    Chris W. Parker Guest

  2. #2

    Default RE: [PHP] Need help - past deadline

    Jay Fitzgerald <mailto:jayfitzbayou.com>
    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.
    Chris W. Parker Guest

  3. #3

    Default 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/>[url]http://www.bayou.com[/url]
    >Toll Free: 888.30.BAYOU (22968)
    >Vox: 318.338.2034 / Fax: 318.338.2506
    >E-Mail: <mailto:jayfitzbayou.com>jayfitzbayou.com
    >ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf
    >=============================================== =
    David Otton Guest

  4. #4

    Default 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="rowspace">&nbsp;</TD>
    <td class="space" colspan="15">&nbsp;</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/>[url]http://www.bayou.com[/url]
    Toll Free: 888.30.BAYOU (22968)
    Vox: 318.338.2034 / Fax: 318.338.2506
    E-Mail: <mailto:jayfitzbayou.com>jayfitzbayou.com
    ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf
    ================================================
    Jay Fitzgerald Guest

  5. #5

    Default 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="rowspace">&nbsp;</TD>
    <td class="space" colspan="15">&nbsp;</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 - [url]http://www.bayou.com[/url]
    Toll Free: 888.30.BAYOU (22968)
    Vox: 318.338.2034 / Fax: 318.338.2506
    E-Mail: [email]jayfitzbayou.com[/email]
    ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf
    ================================================
    Jay Fitzgerald Guest

  6. #6

    Default 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="rowspace">&nbsp;</TD>
    <td class="space" colspan="15">&nbsp;</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="green"><input 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 - [url]http://www.bayou.com[/url]
    Toll Free: 888.30.BAYOU (22968)
    Vox: 318.338.2034 / Fax: 318.338.2506
    E-Mail: [email]jayfitzbayou.com[/email]
    ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf
    ================================================
    Jay Fitzgerald Guest

Similar Threads

  1. CFP: LL3; Submission deadline Oct. 17
    By Jeremy Hylton in forum PHP Development
    Replies: 0
    Last Post: October 10th, 04:08 AM
  2. need help - past deadline
    By Jay Fitzgerald in forum PHP Development
    Replies: 0
    Last Post: August 26th, 05:30 PM
  3. please help past deadline
    By Jay Fitzgerald in forum PHP Development
    Replies: 0
    Last Post: August 26th, 05:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139