A few points:
Put the session_start() and as much of processing as possible on top of the file, before any output. This will be useful for emitting http-headers.
When using a database: don't forget to handle exceptions.
When using a database: don't forget to handle charsets.
When selecting from the database: always limit your results. Add pagination of some kind.
Do not use mysql_*, use a db library that offers prepared statements and is as db-independent as possible. I would recommend PDO. I would also recommend getting the data from the db as objects. If necessary you can define a class to hold some methods you need for these objects.
I cuncur with Cygal: using php as the templating language is quite ok. See Wordpress for an example where this is used extensively in themes.
Try to write your HTML in a compact, readable way. No matter what you use for templating: HTML is an important part of your code, and should be just as readable as any other code you write.
Output valid HTML. Don't forget question marks around attribute values, don't forget -Tags.
<?php session_start(); include "config.php"; if( ! $DB_NAME ) die('please create config.php, define $DB_NAME, $DB_USER, $DB_PASS there'); try { $dbh = new PDO("mysql:dbname=$DB_NAME", $DB_USER, $DB_PASS); $dbh->exec('SET CHARACTER SET utf8') ; $result = $dbh->query("SELECT * FROM products LIMIT 0,20"); $products = $result->fetchAll(PDO::FETCH_OBJ); } catch( Exception $e ) { error_log( $e->getMessage() . " ". $e->getTraceAsString() ); include("500-failwhale.php"); exit; } ?> <!DOCTYPE html> <html> <head> <title>Products</title> <meta charset="utf-8"> </head> <body> <table class="with_border"> <tr> <th>Product ID </th> <th>Name </th> <th>Description </th> <th>Price </th> <th>Image </th> <th colspan="2"> Action </th> </tr> <?php foreach($products as $p) : ?> <tr> <td><?= $p->p_id ?></td> <td><?= $p->p_name ?></td> <td><?= $p->p_description ?></td> <td><?= $p->p_price ?></td> <td><?php if ( $p->p_image_path ) : ?> <img src="<?= $p->p_image_path ?>" alt="<?= $p->p_name ?>"> <?php endif; ?></td> <td>edit</td> <td>delete</td> </tr> <?php endforeach; ?> </table> </body> </html>