Forum Moderators: coopster

Message Too Old, No Replies

trouble displaying DB data

         

andrewsmd

2:01 pm on Oct 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have this function
//this function prints out
//all of my test data from the
//tempVotes table
function echoTestData(){

$query = "select count(*) from tempVotes;";
$result = queryDB(connectDB(), $query);
while($row = $result->fetchRow(DB_FETCHMODE_ASSOC)){

echo("{$row['count(*)']} entries<br><br>");

}//while

//the query to get everything from the tempVotes table
$query = "SELECT * FROM tempVotes order by ipAddress, time desc;";
//$query = "SELECT count(sessionID) from tempVotes where sessionID = '9cs52078qo68881jm97088kd13785dg5290';";
$result = queryDB(connectDB(), $query);

echo("<table>");
while($row = $result->fetchRow(DB_FETCHMODE_ASSOC)){
echo("<tr>");
echo("<td>id: ".$row['voteID']." </td>");
echo("<td>trogdor: ".$row['Trogdor']." </td>");
echo("<td>sun: ".$row['Sun']." </td>");
echo("<td>IP: ".$row['ipAddress']." </td>");
echo("<td>Session: ".$row['sessionID']." </td>");
echo("<td>Browser: ".$row['browserInformation']." </td>");
echo("<td>time: ".$row['time']." </td>");
echo("<td>good: ".$row['good'].";</td>");
echo("</tr><br>");
}//while
echo("</table>");

}//echoTestData
Now I know it works because when I don't echo any HTML it prints the table rows fine. However, once I tried to put them into a table it won't display anything. However if I look at the page source it is all there. Anyone know why. Thanks,

RonPK

2:38 pm on Oct 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



echo("</tr><br>");

That is invalid HTML. Try removing the <br> and see what happens...

ogletree

3:47 pm on Oct 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Can you paste what is in the <table> tags from the source code of the generated page. Make sure you change the content so that it is exemplified.

andrewsmd

4:28 pm on Oct 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes it was the <br>. I didn't know that it would make a difference like that. I still think it is funny that the html displayed in the source but not in the page itself. I just used some css to put in a space. Thanks,

ogletree

2:18 am on Nov 1, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Maybe you could have used a </ BR>

andrewsmd

6:30 pm on Nov 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Firefox doesn't like tags like that.