Ich versuche, eine JQM-Tabelle in viewsessions.php
-Datei auszugeben. Ich habe das Thema recherchiert und diese Jquery Mobile Table in PHP code Lösung versucht, aber die Seite lädt nicht mit meinem Code, also habe ich es entfernt, wo die Tabelle funktioniert.Wie bekomme ich eine Jquery Mobile-Tabelle, um in PHP zu echo?
Irgendwelche Ideen, wie man das macht?
viewsessions.php
<?php
$servername = "";
$username = "";
$password = "";
// This code creates a connection to the MySQL database in PHPMyAdmin named 'ibill'
$con=mysqli_connect('localhost','root','cornwall','ibill');
// The connection is then checked, if it fails, an echo is sent back to the page stating a connection error.
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
// This is the query that is sent to the ibill database.
$viewsessions = "SELECT typeofactivity, employer, date, time, amount FROM session_details";
$result = $con->query($viewsessions);
if ($result->num_rows > 0) {
echo "<table><tr>
<th>Type of Activity</th>
<th>Employer</th>
<th>Date</th>
<th>Time</th>
<th>Amount (GBP)</th>
</tr>";
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<tr>
<td>".$row["typeofactivity"]."</td>
<td>".$row["employer"]."</td>
<td>".$row["date"]."</td>
<td>".$row["time"]."</td>
<td>".$row["amount"]."</td>
</tr>";
}
echo "</table>";
} else {
echo "0 results";
}
$con->close();
?>
ich mehrere Seiten innerhalb einer HTML-Datei so bin mit haben nur die Seite mit dem entsprechenden Code unten geschrieben ..
main.php # viewsessions
<!--**********************************************VIEW SESSIONS PAGE*******************************************************************************-->
<!--***********************************************************************************************************************************************-->
<!--********************************HEADER**************************************************************************************-->
<div data-role="page" id="viewsessions">
<div data-role="header" data-id="foo1" data-position="fixed">
<div class='cssmenu'>
<ul>
<li class='active'><a href='#home'>Home</a></li>
<li><a href='#sessionrecord'>Record a Session</a></li>
<li><a href='#viewsessions'>View Sessions</a></li>
<li><a href='#invoice'>Create an Invoice</a></li>
</ul>
</div>
</div><!-- /header -->
<!--********************************HEADER***************************************************************************************-->
<!--********************************MAIN*****************************************************************************************-->
<div data-role="main" class="ui-content">
<p><span class="logout"><a href="logout.php" data-role="button">Sign Out</a></span></p>
<div class="loginphp">
<?php
if (isset($_SESSION['user_session']) and $_SESSION['user_session']!=""){
echo '<p>Signed in as: <span class="uname">' . $_SESSION['user_session'] . '</span></p>'; }
else {
echo 'not working';
}
?>
</div>
<img class="mainlogo" src="/projects/ibill_v3/img/ibill logo.png" alt="iBill Logo" width="200" height="152">
<h1>Recorded Sessions</h1>
<section class="maincontent">
<?php
include "viewsessions.php";
?>
</section>
</div>
<!--********************************MAIN******************************************************************************************-->
<!--********************************FOOTER****************************************************************************************-->
<div data-role="footer">
<footer class="footer">
<p>awilliams©</p>
</footer>
</div>
</div>
<!--********************************FOOTER*****************************************************************************************-->
<!--**********************************************************END OF VIEW SESSIONS PAGE***************************************************************-->
<!--**************************************************************************************************************************************************-->
Ihr Servercode sieht gut aus. Könnten Sie auch den entsprechenden HTML-Code posten? –
Ich habe meine Frage aktualisiert, um den relevanten HTML-Code zu enthalten – asharoo85