First time here? First time here? Newsletter Signup Newsletter
651326 Members and growing! | Flash Jobs
Search tutorials
Author: Jeffrey F. Hill | Website: http://www.snowvids.com

Part II - Setting up the PHP 

The PHP scripts will be better explained by reading the comments in the attached files. Just open up the PHP script with notepad or any other text editor to make changes. 

The first thing we have to do is connect to the database.  You will need to know your database name, account username, and database password. In order to keep this as simple as possible use an include file to list these variables - They will be the same for each one of your scripts.  This is what is contained in the file Include.inc. One thing to note is that often times the $DBhost variable is slightly different then "localhost" - Sometimes it can be "localhost.yourHost.com".

You will notice that at the top of each PHP script there is a line of code something like this: include ('Include.inc'); All this does is to include those variables in the script. It's just an easier way of keeping track of everything. 

Next you want to make a connection to the Database: 

mysql_connect($DBhost,$DBuser,$DBpass);
@mysql_select_db("$DBName");

 You can see how the variables in the Include File are used here. I'm only going to go over in detail the SQL query part of each script. The rest you should be able to figure out by reading through the comments in the File. Also note that for simplicity some basic sercurity precautions where left out. These are not necessary but you might want to include them if you have any type of sensitive data.

» Level Advanced

Added: 2001-07-03
Rating: 8 Votes: 116
(10 being the highest)
» Author
No details available.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!

Comments

  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.