Next steps: tips and resources

Section 7. Next steps: tips and resources

Tips for common tasks

We have covered the basics. Where you go from here is up to you. You know enough
now to implement some of these useful tasks:

User database
You could implement a user database. You can add a login feature to this.
News
You could code a section that always displays the latest news or maybe a “What’s
new” section that’s automatically generated. The TABLE could be something like:

CREATE TABLE news
(
id INT NOT NULL AUTO_INCREMENT,
title VARCHAR(40),
newsbody TEXT,
news_date DATE,
PRIMARY KEY (id),
UNIQUE id (id)
);

And assuming you want to automatically show the title of the latest five news
items, the code could be something like:

<HTML>
<?php
$sql="SELECT * FROM news ORDER by news_date DESC";
$db = mysql_connect("localhost", "root", "");
mysql_select_db("newsdb",$db);
$result = mysql_query($sql,$db);
echo "Latest News:<br>";
$i=1;
while ($myrow = mysql_fetch_array($result))
{
echo "<a
/a><br>";
$i=$i+1;
if($i>5)
break;
}
?>
</HTML>

Product database

You could create a detailed database of your products. Clients could see all the
products or search for particular product.

Resources

You’ll find useful information for further study at these sites:

PHP site
At this official PHP site, you will find PHP source as well as compiled binaries for
both Linux and Windows. You will also find documentation and some useful links
to various PHP sites, including a list of hosting providers that support PHP.

MySQL site
Here you’ll find news, downloads, training information, documentation, and also
job information.

Apache Software Foundation site
The Apache Software Foundation has created some of the best open source
software projects. One of them is the Apache Web Server, which is currently the
most popular Web server on the net.

PHPBuilder site
This is a must-visit resource site for PHP developers. You will find code, tips,
discussion forums, news, jobs, links, and all sorts of useful stuff.

Your feedback

Please let us know whether this tutorial was helpful to you and how we could make it better. We’d also like to hear about other tutorial topics you’d like to see covered. Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *


*