...

View Full Version : Okay i screwed something up....



mymilkexpired
10-22-2003, 10:43 PM
<?PHP

mysql_connect("localhost", "XXXX", "XXXX") or die(mysql_error());
mysql_select_db("XXX") or die(mysql_error());

$query = "SELECT tdate,company,priority,wfmcase,escstatus,description FROM submissions WHERE ostatus ='Open'";


$result = mysql_query($query) or die(mysql_error());
?>
<table width="700" border="1">
<tr>
<td colspan="6">Open Cases</td>
</tr>
<tr>
<td class="table-title">Date</td>
<td class="table-title">Company</td>
<td class="table-title">Priority</td>
<td class="table-title">Status</td>
<td class="table-title">Case</td>
<td class="table-title">Description</td>
</tr>
<?php
while($row = mysql_fetch_array($result)){
echo "<tr><td>" . $row['tdate'] . "</td>
<td>" . $row['company'] . "</td>
<td>" . $row['priority'] . "</td>
<td>" . $row['escstatus'] . "</td>
<td>" . $row['wfmcase'] . "</td>
<td>" . $row['description'] . "</td>
</tr>";
}
?>
<tr>
<td colspan="6">Seperator</td>
</tr>
<tr>
<td colspan="6">Closed Cases</td>
</tr>
<?php
$query2 = "SELECT tdate,company,priority,wfmcase,escstatus,description FROM submissions WHERE ostatus ='Closed'";
$result2 = mysql_query($query2) or die(mysql_error());
while($row2 = mysql_fetch_array($result2)){
echo "<tr><td>" . $row['tdate'] . "</td>
<td>" . $row['company'] . "</td>
<td>" . $row['priority'] . "</td>
<td>" . $row['wfmcase'] . "</td>
<td>" . $row['escstatus'] . "</td>
<td>" . $row['description'] . "</td>
</tr>";
}
?>
<tr>
<td colspan="6">Footer</td>
</tr>
</table>

</body>
</html>


Okay heres the deal, the first query works fine, and returns the results that are "Open" however the 2nd query does not return any results that are closed. There are closed results i have verified them at the mysql console...... why wont they display? what did i do wrong?

mymilkexpired
10-22-2003, 10:48 PM
HA, im an idiot its confirmed...

Maybe i should learn to read what i write better. I found my spelling mistake. On the second query it should have been $row2[''] in the echo command and i had just $row['']

:doofus:

Spookster
10-23-2003, 01:55 AM
Please read our posting guidelines section 2:

http://www.codingforums.com/postguide.htm

before creating any more threads. Your subject does not fit within the parameters of our guidelines.

mymilkexpired
10-23-2003, 01:48 PM
my apologies...

and noted :thumbsup: :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum