flemingmike Posted September 20, 2010 Share Posted September 20, 2010 anyone able to see if i missed something small? <?php include "config.php"; echo "<left><br />headlogo <table width='96%' cellpadding='1' cellspacing='1' border='1'> <tr> <td width='37%' colspan='4'><b>gname</b></td> </tr> <tr> <td width='25%'>Ladder</td> <td width='25%'>Game</td> <td width='25%'>Join</td> <td width='25%'>Rules</td> </tr>"; $ladders=mysql_query("SELECT id,jobNO,companyID FROM jobno WHERE companyID='$cid' ORDER BY name"); while(list($jid,$jjobno,$jcompanyID)=mysql_fetch_row($ladders)){ echo " <tr> <td width='25%'>$jid</td> <td width='25%''>$ccompany</td> <td width='25%'>$caddress</td> <td width='25%'>$jjobno</td> </tr>"; } echo "</table></left>"; } echo "<br /><br />"; ?> Quote Link to comment Share on other sites More sharing options...
litebearer Posted September 20, 2010 Share Posted September 20, 2010 where are you setting value of $cid? Quote Link to comment Share on other sites More sharing options...
flemingmike Posted September 20, 2010 Author Share Posted September 20, 2010 so i switched it now to this. it is getting the data, but only the first result is showing in the table. Quote Link to comment Share on other sites More sharing options...
Miss_Rebelx Posted September 20, 2010 Share Posted September 20, 2010 Can you post the updated code please? Quote Link to comment Share on other sites More sharing options...
flemingmike Posted September 20, 2010 Author Share Posted September 20, 2010 oops.. sorry <?php include "config.php"; echo "<left><br />headlogo <table width='96%' cellpadding='1' cellspacing='1' border='1'> <tr> <td width='37%' colspan='4'><b>gname</b></td> </tr> <tr> <td width='25%'>ID</td> <td width='25%'>Company ID</td> <td width='25%'>Job Number</td> </tr>"; $result = mysql_query("SELECT * FROM jobno"); while($row = mysql_fetch_array($result)) { $jid=$row["ID"]; $jjobno=$row["jobNO"]; $jcompanyid=$row["companyID"]; echo " <tr> <td width='25%'>$jid</td> <td width='25%''>$jcompanyid</td> <td width='25%'>$jjobno</td> </tr>"; echo "</table></left>"; } echo "<br /><br />"; ?> Quote Link to comment Share on other sites More sharing options...
shlumph Posted September 20, 2010 Share Posted September 20, 2010 You're closing your table tag inside of your while loop, which is probably causing a rendering problem. Quote Link to comment Share on other sites More sharing options...
flemingmike Posted September 20, 2010 Author Share Posted September 20, 2010 thanks. im not very good but very interested. that worked Quote Link to comment Share on other sites More sharing options...
shlumph Posted September 20, 2010 Share Posted September 20, 2010 Nice Quote Link to comment Share on other sites More sharing options...
flemingmike Posted September 20, 2010 Author Share Posted September 20, 2010 another question, if i break out of php for a form, how can i have the form display a php variable? here is what im trying: $d = date("d"); $m = date("m"); $y = date("Y"); ?> <form method="post"> Month: <select size="1" name="M"> <option selected><?php '$m' ?></option> <option>1</option><option>2</option> Quote Link to comment Share on other sites More sharing options...
the182guy Posted September 20, 2010 Share Posted September 20, 2010 Close, try: <option selected><?php echo $m; ?></option> Quote Link to comment Share on other sites More sharing options...
flemingmike Posted September 20, 2010 Author Share Posted September 20, 2010 nope. Quote Link to comment Share on other sites More sharing options...
the182guy Posted September 20, 2010 Share Posted September 20, 2010 $m must be null, blank or empty then. Show us the entire code... Quote Link to comment Share on other sites More sharing options...
flemingmike Posted September 20, 2010 Author Share Posted September 20, 2010 it isnt blank. if i do a print '$m'; at the end of the form, it displays. <?php include 'config.php'; $d = date("d"); $m = date("m"); $y = date("Y"); ?> <form method="post"> Month: <select size="1" name="M"> <option selected><?php "$m"; ?></option> <option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option> <option>9</option><option>10</option><option>11</option><option>12</option></select> Day: <select size="1" name="D"> <option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</ option><option>10</option><option>11</option>option>12</option><option>13</option><option>14</option><option>15</option><option>16</option><option>17</opt ion><option>18</option><option>19</option><option>20</option><option>21</option><option>22</option><option>23</option><option>24</option><option>25</option ><option>26</option><option>27</option><option>28</option><option>29</option><option>30</option><option>31</option></select> Year: <select size="1" name="Y"> <option>2010</option><option>2011</option></select> <input name="add" type="submit" id="add" value="GO"> </form> <?php echo "<table border='1'> <tr> <th>ID</th> <th>Name</th> <th>Job Number</th> <th>Date</th> </tr>"; $result = mysql_query("SELECT * FROM staff WHERE date >= '".date('Y-m-d').' 00:00:00'."' AND date < '".date('Y-m-d').' 23:59:59'."' "); while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row["ID"] . "</td>"; echo "<td>" . $row["Name"] . "</td>"; echo "<td>" . $row["jobNO"] . "</td>"; echo "<td>" . $row["Date"] . "</td>"; echo "</tr>"; } echo "</table>"; ?> Quote Link to comment Share on other sites More sharing options...
the182guy Posted September 20, 2010 Share Posted September 20, 2010 Your code is still showing as this... <?php "$m"; ?> Quote Link to comment Share on other sites More sharing options...
flemingmike Posted September 20, 2010 Author Share Posted September 20, 2010 i got it. i had to put in echo "$m"; thanks all Quote Link to comment Share on other sites More sharing options...
flemingmike Posted September 20, 2010 Author Share Posted September 20, 2010 oops.. you told me to do that. lol. sorry man. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.