I’m trying to make a page that once someone logs in, they can view the contents of the database that is associated with them in a clear, concise and organized way. Currently, I just have PHP echoing HTML and variables to make the page. i.e. I did what I knew would work.
I am new to everything programming and have done Javascript DOM manipulation so I can’t see this echo thing can’t being the right.
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['First_Name'] . "</td>";
echo "<td>" . $row['Last_Name'] . "</td>";
echo "<td>" . $row['Employee_No'] . "</td>";
echo "<td>" . $row['Job_No'] . "</td>";
echo "<td>" . $row['Job_Name'] . "</td>";
echo "</tr>";
}
echo "</table>";
I know that technically, this will work, but I am just looking for basic information on how to do this properly, preferably in an easy to understand format.
http://php.net/manual/en/book.dom.php
I found this, it looks like it is potentially what I need, but I am not experienced enough to know and it’s not the most beginner friendly documentation.
In PHP when you create HTML output, you’re not bound to the DOM. Because different to javascript, there is no DOM to share with the browser. Instead you can just create text output like with
echoin your question. That’s perfectly alright.