Jump to content

thecase

Members
  • Posts

    63
  • Joined

  • Last visited

Everything posted by thecase

  1. Hi, This is part of my table code echo "<td align=\"center\"><font color=\"{$colors[$row['presenter1status']]}\">{$row['presenter1']}</font> <input type='checkbox' /></td>"; Now what I was hoping to do is write some code to check what is selected and what isnt to be then able to write some queries to the database. Can anyone give any pointers Thanks
  2. Perfect. Thanks
  3. Do you mean something like this $dropdown = " while ($row = mysql_fetch_array($query, MYSQL_NUM)) { <option value={$row['0']}>{$row['1']} {$row['2']} </option>\n } </select> "; It comes back with Notice: Undefined variable: row
  4. Hi, This is my code $query = mysql_query("SELECT id, username, lastname FROM users ORDER BY username ASC"); echo '<h1>Add Rota</h1> <table> <tr> <td><b>Presenter 1:</b></td> <td> <select name="presenter1"> <option value="0">Pick presenter</option> '; while ($row = mysql_fetch_array($query, MYSQL_NUM)) { echo "<option value=\"{$row['0']}\">{$row['1']} {$row['2']} </option>\n"; } echo ' </select> </td> <td></td> <td></td> <td></td> </tr> <tr> <td><b>Presenter 2:</b></td> <td> <select name="presenter2"> <option value="0">Pick presenter</option> '; while ($row = mysql_fetch_array($query, MYSQL_NUM)) { echo "<option value=\"{$row['0']}\">{$row['1']} {$row['2']} </option>\n"; } echo ' </td> I am trying to define the $query to use in a dropdown twice although I cannot re use it and this doesnt work for the second dropdown. I was trying to only write the query out once to save on resources. Any suggestions would be great Thanks
  5. I actually did this. Thanks for the tip
  6. Great. Thanks
  7. Hi, Here is a tiny bit of my code $r = mysql_query ($query); while ($row = mysql_fetch_array ($r, MYSQL_ASSOC)) { echo "<tr> <td align=\"center\">"; echo date("M-d-Y", mktime(0, 0, 0, $row['month'], $row['day'], $row['year'])); echo "</td> "; if ($row['presenter1status'] == '0') { echo "<td align=\"center\"><font color=\"#FF9900\">{$row['presenter1']}</font></td>"; } elseif ($row['presenter1status'] == '1') { echo "<td align=\"center\"><font color=\"green\">{$row['presenter1']}</font></td>"; } elseif ($row['presenter1status'] == '2') { echo "<td align=\"center\"><font color=\"red\">{$row['presenter1']}</font></td>"; } if ($row['presenter2status'] == '0') { echo "<td align=\"center\"><font color=\"#FF9900\">{$row['presenter2']}</font></td>"; } elseif ($row['presenter2status'] == '1') { echo "<td align=\"center\"><font color=\"green\">{$row['presenter2']}</font></td>"; } elseif ($row['presenter2status'] == '2') { echo "<td align=\"center\"><font color=\"red\">{$row['presenter2']}</font></td>"; } if ($row['engineerstatus'] == '0') { echo "<td align=\"center\"><font color=\"#FF9900\">{$row['engineer']}</font></td>"; } elseif ($row['engineerstatus'] == '1') { echo "<td align=\"center\"><font color=\"green\">{$row['engineer']}</font></td>"; } elseif ($row['engineerstatus'] == '2') { echo "<td align=\"center\"><font color=\"red\">{$row['engineer']}</font></td>"; } echo "</tr> I was wondering if there is a better way of doing this as I think including this many ifesle statements in a while loop that could go round about 40 times might be very heavy on the resources. Thanks
  8. Hi, Please see the imaged attached thats what I plan on creating, the script I am creating is a schedule system. Users are able to add a comment in but I need this displayed on the table. There is room to add another 3 columns presenter1comment, presenter2comment, engineercomment but this will make the table look squashed. Where would you display the comments. I was also thinking having a mouse over the name and then a box popup with the comment - not sure how to do this though. Thanks [attachment deleted by admin]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.