Friday, May 25, 2012

How to Make a Effortless Php News Program

Hi and welcome to my tutorial!

Now allows get begun!

Initially we might possibly want to make the table in MySQL second hand to retail store our news in!

The SQL file looks like this:

paste that into a text document and help you save it as news.sql (Just remember to pick "All Information..."

Now allows get begun on the method! Initially we will make the script that gathers the news and outputs them and then we will make the script that adds the news to the database!

Action 1:

Begin by making a file referred to as index.php in your webserver.

In that file we will of class begin the process of by composing the PHP opening tags like this:

Action 2:

Now we will join to our MySQL server by employing mysql_join() and mysql_pick_db() like this:

Now we are related to the database!

Action 3:

Now allows accumulate the news and output them! Like this:

Posted at ".$r['date']." by ".$r['author']."" echo $r['content']."" } ?>

Now we are conducted with the script outputs the news!

Action four:

Now allows make the script that inserts the news into the database! It looks like this:

now help you save that as acp.php.

Now you might be conducted!

Now you have a news method in which you can publish news from acp.php and see the news you posted on index.php!

Thank you for studying!





No comments:

Post a Comment

Note: Only a member of this blog may post a comment.