Here is my code, works fine and prints out everything I want it to. But on the end of each cell I would like a form that makes a button which will allow the user to configure the item that the row in the table describes. I want to know how I can escape out of php to use html again, I’ve tried double quotes but this does not work, I was wondering if anyone could explain to me how to do this.
<?php
$data = mysql_query("SELECT * FROM basestation WHERE email_address ='$email'")
or die(mysql_error());
Print "<table border = 1>";
while( $info = mysql_fetch_array( $data ) ) {
Print "<tr>";
Print "<th>Name:</th> <td>".$info['base_station_id'] . "</td>";
Print "</tr>";
Print "<tr>";
Print "<th>Serial Number:</th> <td>".$info['serial_no'] . "</td> ";
Print "</tr>";
}
Print "</table>";
?>
PHP code will only being executed between the opening
<?phpand the closing?>php tags. However you are free to use multiple php sections per file.So, you can just close the PHP section using
?>. Then after writing HTML content you can open<?phpagain.Here comes a little example. It creates a couple of
<a>achors from an imaginal array$links:Note that this mostly leads to unreadable code. But it is possible and can be used.
Also not that there is short syntax available for shorter echo syntax. But you’ll have to make sure that it is enabled in your php configuration. Using the shorter syntax, may example from above could look like this:
You’ll find a good documentation on the PHP website