See the code, I do not understand why a piece of complete PHP code to write separately? What if I put it together?
Include ("conn/conn.php");
$query =mysql_query ("Select Book.barcode,book.id as Bookid,book.bookname,bt.typename,pb.pubname,bc.name from Tb_ BookInfo book joins Tb_booktype BT on Book.typeid=bt.id joins tb_publishing PB on book. ISBN=PB. ISBN join tb_bookcase BC on Book.bookcase=bc.id ");
$result =mysql_fetch_array ($query);
if ($result ==false) {
?>
}else{
?>
Reply to discussion (solution)
The part of the black part is the HTML code, not the PHP code
You can say that HTML is embedded in PHP, or HTML is embedded in the PHP
The advantage of this notation is that you can use visual HTML tools (such as DW) to observe and modify HTML parts
Together, the HTML part will be placed in the string. Because of the simultaneous existence of single double quotes, escaping causes visibility to degrade
If the custom delimiter is used, the aesthetics of the code is reduced due to the rule
You can also put in a separate file, include in. But leaving the visual space will affect the continuity of thought.
First of all, PHP is in the server solution, and HTML is in?? The solution of the device. php? is better than HTML first line.
Because it is not a PHP generation, so it should be divided into??? Php???
If you need to close up? The entire paragraph is PHP, in the HTML you want to use the echo of PHP??。
For example
'; Echo '; Echo ' No book information! '; Echo '; Echo '; Echo '
'; Echo '
'; Echo '
| '; | '; Echo '
'; Echo '
';} Else{}?>
html+php Mixed Mode
With template smarty, PHP and HTML can be separated for easy maintenance.
I use SQL server2005, how should the query function (red part) be changed to use sqlsrv function to write?