HTML Tables Disappearing due to SQL Variable

36 views
Skip to first unread message

Tomas Medina

unread,
Jul 18, 2017, 1:17:23 PM7/18/17
to BeagleBoard
I installed PHP, MySQL 5, and Light TPD on my Beaglebone Black Wireless (running Debian image 2017-07-01). I tried creating a webpage that displays a MySQL table, but noticed that the table wasn't even appearing. So in order to isolate the problem, I created a simple PHP program that does nothing but display some text and a table with only one row. I began adding things from the larger program one at a time until I found what was causing the tables to disappear. I discovered that the highlighted line is the culprit:

<html>
<head>
 <title>Table Test</title>
 
 <link rel="stylesheet" type="text/css" href="styles.css">

</head>

<BODY>

<p>

<?php

echo "Table Test<br>";

//////////////////////////////////////////////////////
//        Connecting to the Database
//////////////////////////////////////////////////////
$con = mysqli_connect("localhost","root","Force1$", "AUTO");

//Print HTML table
echo "<TABLE width=40% cellpadding=5 cellspacing=0 border=1>";
echo "
<TR>
<TD><b>ID</TD>
<TD><b>LOCATION</TD>
<TD><b>SEQUENCE</TD>
<TD><b>TIME</TD>
<TD><b>UPDATE</TD>
<TD><b>DELETE</TD>
</TR>";

?>

</body>
</html>

This code displays the table just fine in an older Beaglebone (Debian image 2015-11-12). I find it hard to believe that simply declaring a variable would cause something like this to happen. Please, any help on this matter would be greatly appreciated. Thank you!

Dennis Lee Bieber

unread,
Jul 18, 2017, 3:41:44 PM7/18/17
to beagl...@googlegroups.com
On Tue, 18 Jul 2017 10:17:23 -0700 (PDT), Tomas Medina
<to...@evatech.net> declaimed the following:

>the tables to disappear. I discovered that the highlighted line is the

No "highlighted line" made it through gmane's server...
I don't know PHP, but based upon what came through here -- there is no
logic to fetch/display rows from the database, nor even to end the HTML
TABLE structure. Heck, I'd probably move the contents of the two "echo"
statements out into pure HTML (ie; just

<TABLE ...>
<TR>
<TD>...</TD>

positioned /before/ the <?php )
--
Wulfraed Dennis Lee Bieber AF6VN
wlf...@ix.netcom.com HTTP://wlfraed.home.netcom.com/

Tomas Medina

unread,
Jul 18, 2017, 4:32:45 PM7/18/17
to BeagleBoard
Putting the table outside of the php marks did solve the invisibility problem. Thank you, I will leave this topic open in case any more problems arise.
Reply all
Reply to author
Forward
0 new messages