OnOpenSource asked:


Web Design experts, Luke Welling and Laura Thomson discuss key concepts and techniques contained in thier forthcoming 4th edition of PHP & MYSQL Web Development book coming in Feb ‘08. http://www.informit.com/store/product.aspx?isbn=0672329166

Part 2 of this, and many more interviews can be found FREE at the OnOpenSource Vidcast site:http://www.informit.com/podcasts/channel.aspx?c=1977eb71-4a34-42dd-a7d0-7952a08c527e

www.InformIT.com/podcasts

PHP and MySQL Web Development teaches you to develop dynamic, secure, commerical Web sites. Using the same accessible, popular teaching style of the three previous editions, this book has been thoroughly updated to reflect the rapidly changing landscape of MySQL and PHP. The fourth edition of PHP and MySQL Web Development includes updated examples and coverage of recent versions of PHP 5.1, new coverage of PHP security and Web 2.0 social networks, and advance information on the features of the forthcoming PHP 6, including Unicode and new object-oriented functionality.

Luke Welling and Laura Thomson are co-founders of Tangled Web Design, and recently won the CCH Emerging Technology award for a site they built using PHP.

mysql
Lorene asked:


Free cPanel Web Hosting with PHP5/Mysql - no advertising!

Register now: http://www.000webhost.com/73018.html

We can offer you a free web hosting package packed with advanced features for hosting & building professional dynamic websites. We provide secure free web space with all the web hosting tools you could possibly ever need.

Our package includes:

- 1500 MB of Disk Space, 100 GB Bandwidth

- Host your own domain (http://www.yourdomain.com)

- cPanel Powered Hosting (you will love it)

- Over 500 website templates ready to download

- Easy to use website builder

- Free POP3 Email Box with Webmail access

- FTP and Web based File Manager

- PHP, MySQL, Perl, CGI, Ruby.

- And many more..

Click here to visit us: http://www.000webhost.com/73018.html     

Welcome to the first and only - user donations supported free web hosting service. We provide you will the most reliable and feature-rich web hosting service without advertising. Lightning fast website loading speed, zero downtime, fanatic user support and instant activation - that is why you will love doing business with 000webhost.com - $0.00 webhost

1500 MB Disk Space, 100 GB Data Transfer

We have enough room for your website, emails and databases. All our servers are also connected to dedicated 10mbps internet lines, so we can give you 100 GB data transfer absolutely free.

PHP with MySQL Database Support

Unlike other free webhosts we do support PHP and MySQL with no restrictions. You get full access to the latest version of PHP and MySQL. The following PHP features are fully supported:



PHP mail() function and Sendmail

Curl, GD2 library, ImageMagick, Zend

fopen() and PHP sockets

safe_mode is OFF, file uploads ON

Zend Optimizer support, Ioncube loader.. and much more features are enabled



cPanel Control Panel

cPanel is the most advanced control panel in industry. It has tons of features and it is easy to use even for newbie. Interactive help, video tutorials will help you to understand why cPanel is the best and you will never want to switch to anything else. cPanel is widely used by the paid hosts, but we are giving you it absolutely free!

Fantastico De Luxe 1-Click Autoinstaller

Finally! We are the first free web hosting company that gives you access to Fantastico Autoinstatler. Fantastico is a system designed to make installing popular scripts easy. If you want to improve your web site with a discussion forum or an online gallery to show everyone your latest holiday snaps, you can. With a few clicks of your mouse your web site will be transformed into a fantastic resource for you, your business or your family.

Fantastico can install over 40 popular scripts such as: Drupal, Geeklog, Joomla, Xoops, WordPress, b2evolution, Support Logic Helpdesk, phpBB2, SMF, OS Commerce, ViPER Guestbook, Coppermine Photo Gallery, PhpWiki, PHPauction, WebCalendar and more.

Website Builder Software

Our hosting is supercharged with SiteReptile website builder. SiteReptile is the easiest to use website builder in the market. Just 3 steps (enter your login details, select one of 330 high quality templates and click ‘publish’) and your website is ready online for editing. Just one click - and you have subpage created or contact form inserted.

Frequency Asked Questions!



Why it’s all free? How do you earn?

We have 3 funding sources: we own paid hosting company, and we have strong financial ground; our service is user donations supported - each day we receive donations from happy users; and finally, we earn by offering paid upgrades for those who need more disk space and more services.

How long your hosting will be free?

Forever! Now we are 4 years in paid hosting business and over a year in free hosting market and we don’t see any problems to keep everything up and running.

What are your guarantees?

1. We own all servers. No one can shut down or reload any server with your data.

2. Bandwidth will never run out, we have dedicated 10mbits connection lines on each server.

3. All accounts are backed up every 30 days and stored on remote server. You can also generate and download your account backup from cPanel 24 hours a day, 365 days a year.

mysql
Groshan Fabiola asked:


The success and the longevity of any prominent business nowadays depend on powerful application infrastructures and effective, reliable management and development solutions. In present, a wide range of IT companies are striving to provide business owners with better application management and new, state-of-the-art development solutions and tools, vital for increasing productivity and facilitating process development for any business. In order to improve the overall performance of commonly used application servers, and to enhance the efficiency of specific application programs, more and more IT companies are currently aiming to develop new, competitive software programs that support popular, commonly used databases. Such software products offer an extended set of features that help businesses implement better management and development solutions and also considerably reduce the time, effort and costs of process development.

Most software products implement support for MySQL databases, providing users with a complete set of improved administration and development solutions. Enhancing and correcting the features provided by the popular MySQL Manager application, MySQL Turbo Manager is by far the best software solution for MySQL database management, administration and development in present. The small MySQL Manager application included by Mac OS X Server provides users with a GUI interface for a set of basic actions. However, the standard MySQL Manager application can’t effectively meet today’s requirements, users needing more powerful and complex applications for creating, managing and interacting with various databases.

MySQL Turbo Manager accounts for the minuses of the regular MySQL Manager application, also implementing new reliable features that account for all the issues of an effective process development. MySQL Turbo Manager is nowadays considered to be a very powerful and easy to use administration tool, successfully meeting the requirements of a wide range of businesses. MySQL Turbo Manager is an effective MySQL Front End, a Graphical User Interface (GUI) Server for MySQL, renowned as the most reliable administration tool in present.

Similar to MySQL Turbo Manager, Dream Coder is a very effective Front End for Oracle database, regarded as a powerful PL/SQL IDE by a large number of businesses from various fields of activity. Dream Coder for Oracle is undoubtedly the most effective PL/SQL IDE (Integrated Development Environment), greatly reducing the time and costs required by the development process. With the help of Dream Coder for Oracle databases, PL/SQL developers can now browse trough a more intuitive and user-friendly GUI and perform various tasks with a minimal investment of time and effort.

Dream Coder for Oracle is a complete software product, providing PL/SQL developers with an extensive set of features such as building and executing queries, creating and executing scripts, creating and modifying database objects, user session monitoring, database monitoring and many more. Along with MySQL Turbo Manager, Dream Coder for Oracle is nowadays a highly requested software product, greatly facilitating process development and improving productivity with a small investment of time and effort.

So if you want to find out more information about MySQL Front End or about PL/SQL Developer, or even about PL/SQL IDE please click these links.

mysql
John Dixon asked:


In this article I’ll try to describe how to develop a very simple Content Management System (CMS). I’ve chosen PHP as the server-side scripting language and MySQL as the database management system purely because I think they are fairly easy to use and they do the job very well.

I won’t spend any time describing CMSs, what they are, or why you should or should not use them as there are plenty of excellent articles around that describe them perfectly well. I’ll just explain one way of developing a CMS.

This CMS consists of a single web page (index.php) that can have its contents updated by use of a form (editPage.php). The contents entered via the form are stored in a database, and are accessed and displayed by the web page. Although this CMS is too simple to be of any real use, it could be used as the starting point for a real life CMS solution.

There are four files in this project:

cms.sql

editPage.php

updatePage.php

index.php

cms.sql

This file creates a database called cms, and creates a table in that database called page. It also loads some intial data into the table. You only need to use this file once.

editPage.php

This web page contains a simple form that can be used to enter (and edit) the contents displayed by index.php.

updatePage.php

This is the form handler - the script that processes the data (entered in editPage.php) and inserts it into the database table (page).

index.php

This is the web page that displays the data held in the database table.

cms.sql

1. CREATE DATABASE cms;

2. USE cms;

3. CREATE table page (

4. pageID integer auto_increment,

5. contents text,

6. primary key (pageID)

7. );

8. insert into page (pageID, contents) values (’1′, ‘dummy text’);

Line 1 creates a database called cms in the MySQL database management system.

Line 2 tells MySQL to use the database for the subsequent commands.

Line 3 creates a table in the database.

Line 4 creates a column called pageID, which will contain integers, and which will be automatically incremented as new records are added to the table. As we only have one web page (index.php) in our imaginary website, we will only have one record and therefore one integer: 1. If we added additional pages to the table, they would be automatically numbered (2, 3, 4, etc).

Line 5 creates a second column called contents, which will contain text. This is where the editable contents displayed by index.php will be stored.

Line 6 sets pageID as the primary key, which you can think of as a reference for the table. As we only have one table, which will contain only one record, we won’t make any use of the key. I’ve included it though because it’s good practice to do so.

Line 7 simply closes the bit of code that was started in line 3.

Line 8 inserts some intial data into the table: 1 as the first (and only) pageID, and ‘dummy text’ as the contents of the first record.

editPage.php

(Note that for display considerations, I’ve used square brackets ‘[' instead of angle brackets for tag names.)

1. [html]

2. [head]

3. [title]Really Simple CMS[/title]

4. [/head]

5. [body]

6. [h1]Really Simple CMS[/h1]

7. [?php

8. mysql_connect("localhost", "root", "password");

9. $result = @mysql_query("SELECT contents from cms.page");

10. while ($row = mysql_fetch_assoc($result)){

11. $contents = $row['contents']; // Do not change these to angle brackets

12. }

13. ?]

14. [form name="form1" method="post" action="updatePage.php"]

15. Enter page content:[br][textarea rows="10" cols="60" name="contents"][?php echo "$contents" ?][/textarea]

16. [input type="submit" name="Submit" value="Update Page"]

17. [/form]

18. [/body]

19. [/html]

Most of this file is fairly simple HTML that doesn’t need explaining. However, the following bits of code are probably worth discussing.

Lines 7 through to 13 contain PHP code to connect to the database and extract the contents of the web page.

Line 15 contains a tiny bit of PHP code to display the contents in the form’s textarea. This line shows how easy it is to integrate bits of PHP code into lines of HTML code.

Remember though that in order to use PHP code in an HTML page, the file has to have an extension of .php. If it does not, the PHP code will not be processed by the web server.

updatePage.php

1. [?php

2. $contents=$_REQUEST['contents']; // Do not change to angle brackets

3. mysql_connect(”localhost”, “root”, “password”);

4. $result = @mysql_query(”UPDATE cms.page SET contents=’$contents’”);

5. mysql_close();

6. ?]

This is the form handler, that’s to say, the script that processes the data entered into the form (in editPage.php).

Line 1 signifies the start of a PHP script.

Line 2 requests the contents that were posted from the form. We could have written

$contents=$_POST['contents']; instead if we had wanted to.

Line 3 connects to the MySQL database server, setting up the host name, which I’ve assumed to be localhost, the database user, which I’ve assumed to be root, and the password needed to connect to the database. Naturally, I have no idea what this would be for your system so I’ve just written the word password.

Line 4 updates the page table in the cms database with the new contents.

Line 5 closes the database connection.

Line 6 closes the PHP script.

index.php

1. [html]

2. [head]

3. [title]Home Page[/title]

4. [body]

5. [h1]Home Page[/h1]

6. [?php

7. mysql_connect("localhost", "root", "password");

8. $result = mysql_query("select contents from cms.page");

9. while ($row = mysql_fetch_assoc($result)){

10. $contents = $row['contents']; // Do not change to angle brackets

11. }

12. echo $contents;

13. ?]

14. [/body]

15. [/html]

This is the web page that displays the contents from the database.

Most of the lines in this web page are pretty straight forward and don’t need explaining. Lines 6 to 13 contain the PHP script that extracts the contents from the database and displays (echos) it in the browser.

Installing/Running the CMS

To use the CMS you need to copy the files onto your web server into the area allocated for web pages. Your web server needs to support PHP and MySQL; if it doesn’t, the CMS won’t work.

You also need to use the correct database connection names and passwords (those used in the mysql_connect lines in the PHP scripts).

Exactly how you run the cms.sql file to set up the database and database table will vary from web server to web server so it’s difficult to give precise instructions here. If you have a phpMyAdmin icon or something similar in your web servers control/administration panel you should be able to use that.

Once you’ve set up the database and table, you can simply browse to the editPage.php web page and update the database contents. You can then browse to the index.php page to view the updates.

cpanel
IC asked:


If you’re looking around and browsing across different hosting companies in order to find which one has the best features which will match your needs then you should definitely take a look at the type of back-end and administration script that they offer to their subscribers. Managing a hosting account can be pretty intimidating at first however, as time goes by and you get more experience about how to use and operate the administration area and you’ll want to have more features that will save you time and automate many processes.

Having all these ideas in mind brings us to a very efficient hosting management script which has become popular because it is intuitive and provides a lot of information which can be accessed quite easily, the name of this administration script is Cpanel. Unlike many other administration areas Cpanel is organized in a very neat way, at the top of the screen it shows you when it was the last time you log in to your account and from what IP address, on the left side of the administration screen you will find two sidebars which provide a lot of information about your account and about the server you are using.

The top left sidebar provides the information which is related to your account such as the hosting package that you have signed up for, the amount of domains and parked domains that you have, the number of databases which have been created, your available disk space, the amount of bandwidth that you used so far, the number of FTP accounts created, etc. — the lower left sidebar is configured in order to show information which is relevant to the server, this may be: the operating system that you’re running on, the kernel version, your PHP version and diversion of all other modules that you may be utilizing.

In addition, Cpanel is compatible with a very popular script which is called Fantastico, this script has been designed to automate the installation of common scripts, there are well over 50 different scripts that Fantastico is able to handle for instance, if you need to have a forum and WordPress installed for one domain you could easily have this process gone by using this script which will create your databases, install all the files required in the server and configure all the permissions that will allow you to use those scripts in a matter of a few seconds, if you compare the use of this script to doing a manual installation you will see that this is an amazing script to have. Cpanel also provides a series of icons which illustrate the many sections that you can access and configure instead of providing menus which may not be very intuitive.

May
19
Filed Under (Entertainment) by Nick
fannehh asked:


php mysql

cpanel
Koz Huseyin asked:


Hosting has been taken by storm recently with more and more hosting companies opting to use cPanel hosting as their hosting control panel. cPanel hosting has many great features which make managing your web site so much more easier.

Is your current website hosting company using a control panel which makes managing your website and domain very difficult? cPanel hosting transforms this into an easy to manage interface. And the best part of knowing many hosting companies are using cPanel hosting is that when you move hosting, there is no need for a long learning curve.

cPanel hosting allows you to easily log into the control panel or cPanel and manage your domain from anywhere you choose. You can save a lot of time and easily add domains, sub domains and email accounts. Because cPanel interfaces directly with the server (the actual computer which runs your website), most changes are done right before your eyes. I have been with hosts in the past which show me a message saying that my newly created email address could take 10 minutes to start working. Or setting up a sub domain taking as much as 3 hours to start working after creation.

* Features of cPanel hosting which make it irresistible

Please note that the features that follow may or may not be in your cPanel. Even though cPanel hosting looks the same, some servers could have same or different features.

* cPanel Hosting Features

* Mail

Allows you to add email addresses, remove email addresses, and manage your email. You also gain web mail access. Which I find is a great feature, which allows me to have Outlook in the office showing me email, which I can also look at email out of the office easily.

* Autoresponders

cPanel hosting gives you an easy way to set up an autoresponder. Let us say you have a product. You could get people to email an autoresponder email address, and they would receive more information about a particular product.

* Cron Jobs

cPanel hosting allows you to set up cron jobs easily. A cron job comes useful if you want a page or script to run automatically at certain intervals.

* MySql Hosting

cPanel hosting generally comes with the ability to have MySql databases. These databases become crucial for any modern website running with a database backend such as WordPress. MySql within your cPanel hosting is very easy to create a database. Almost everything within a cPanel hosting account is point and click.

* Website statistics

When you buy cPanel hosting, you get access to a variety of ways to view the stats for your website. With cPanel hosting, you can look at the original log files or use Webalizer or Awstats. These are great ways to learn more about the visitors to your website, you can even find out how often Google, Yahoo and other search engines visit your site. Another great feature is to see latest visitors, which shows you who came in last, and where to your website.

* Fantastico! And Script Library

This is truly Fantastico! And I think I know why they called this great feature within cPanel as Fantastico. Fantastico allows you to create a lot of different types of websites in a few clicks. If you have ever installed WordPress, then you will know that even with the 5 minutes installation time, you want something simpler. Fantastico contains such products as WordPress, Joomla, Drupal, phpBB and many others.

Fantastico gives you a form, and with only putting in the most minimal of information, you have a brand new site in most cases less than 60 seconds! It is enough to make any web designer from few years back, look in awe.

cPanel hosting comes with many features, and you can be sure that when you choose cPanel hosting, you’re very small needed learning curve can be used with other hosts sporting cPanel hosting. In the past a lot of the smaller web hosting companies opted to use cPanel, now more and more larger hosting companies are offering the benefits of cPanel hosting.

mysql
Kazuto asked:


Each time I try to execute the configuration, all but one don’t work. “Start service” has a red X next to it and the error says “Cannot create Windows service for MySQL. Error: 0″. Does anyone know how to fix this?
cpanel
Trevor Mulholland asked:


You may have already read about the reasons to get cPanel reseller hosting. Well, it never hurts to learn a bit more, especially if what you learn will end up being beneficial to your business!

cPanel reseller hosting may be the hottest thing in the market, and you should definitely give it a go if you’re interested in starting your reseller business off on the right foot… but you shouldn’t get into it without reading up on the most important things about it first. This will not only help you appreciate the software more – it will also help you market the software to your prospective clients. If you are targeting first-time owners of websites, you may need to break technical stuff to them gently!

1. User-friendliness. Besides ease of use, the measure of a good software should be how much manual labor it takes away from the end user – and the entrepreneur who has to care for the end user. The automated scripts afforded by cPanel allows your customer to perform various changes or undo them without hassle, thus reducing the strain on you to provide tech support at every given turn.

Plus, the software itself has multi-language software support. If that doesn’t speak of user-friendliness, what does!

2. Brandability. The basic cPanel web management tool is highly customizable. You, as the reseller who purchased the license, should be able to add banners, customize the text and pretty much make your cPanel look like it belongs to you exclusively. This assures that all customers who regularly log into their web panel accounts retain a good impression of you and your reseller hosting company.

3. Regularly delivered statistics. This may seem like a small thing to less detail-oriented individuals, but it’s a big thing to the rest of us – especially for those of us who are running online businesses. Online stores, especially those that are still starting up, rely a lot on affiliate programs, site hits, ad impressions, and other things you may need to look up on even as a reseller (because you might benefit from the knowledge, too!)

As you can see from the above list, a cPanel reseller hosting account would virtually do most of the hard work for you and your customer! This frees up your hands so you can attend to other pressing work, such as marketing your cPanel-enabled hosting services (for you), and drawing more visitors to a website (for your customer).

mysql
Bill Hamilton asked:


Self-Taught PHP/MYSQL: a simple Page Counter

This article is a short introduction to PHP and MySQL using the example of a simple page counter. I will illustrate creating the database in MySQL, connecting to the database from the PHP script, querying the database for information, displaying the information in a web page, and writing the information back to the database. As always, the fastest way to master the process is to jump right in with the code, look it over and use it. We’ll make a MySQL database to store the page names and the number of page views, and use PHP to increment and display the count on a web page. First here is all of the code, and then I’ll go over it in detail:

This goes into a file called “pagecounter.php”



You’ll no doubt have noticed that the script “includes” another, so without further delay here is the “connect.php” file:



The pagecounter.php script needs a database to operate on. Just briefly, here’s how to create it.

Creating the database:

Log in to MySQL at your Unix prompt (which might be #):

# mysql –uYourUserName –pYourPassword

At the MySQL prompt enter these commands:

mysql> create database pages;

mysql> use pages;

mysql> create table counter (pagename varchar(60),hits int, stamp timestamp);

mysql> quit;

Naturally you can create the database and table with utilities or web-based interfaces, but doesn’t it seem simpler to just enter three commands?

If you just wanted some code for a simple counter, this is all you need. Put this text into an SHTML web page, or this text into a php web page, copy the above two files into the same directory, and you’re done.

The first thing you’ll have noticed about the scripts are the dollar signs ($). All variables in PHP scripts start with a $. Anything starting with a $ is a variable. Instructions - statements and functions – end with a semicolon (;). starts the script and it ends with . When your script is hosed, look at these first.

Details about the pagecounter.php script

Line 1

include_once “connect.php”;

The first line in the script is just what it appears to be. It includes whatever is in the file “connect.php”. The “_once” means that it’s only included once, even if you had the line twice in the script. The reason I’ve separated it out is that it’s all the connection stuff to the database. All the php/Mysql scripts will need it, it’s always the same, so you can just put it by itself and use the include function.

Line 2

$pagename=$_SERVER["REQUEST_URI"];

The next line creates a variable called $pagename and sets the value to a special pre-defined variable $_SERVER["REQUEST_URI"]. The brackets [ ] are used by arrays in php. $_SERVER is a pre-defined array of headers and paths. This particular one is the name of the file that accesses the script, i.e., the name of the page that the counter is in.

Line 3

$result=mysql_query(”Select * from counter where pagename=’$pagename’”);

All the database work is done with mysql_query, which sends an SQL command string to MySQL, after you’ve already logged in and connected to the database with the connect.php script. “Select * from counter where pagename=’$pagename’” replaces $pagename with its value. But there’s a quirk here – the single quotes have to be inside the double quotes. If I had it the other way around, with the single quotes outside, the query would be for the text “$pagename” instead of the value. $result is the result set. It can be any name but in tutorial scripts it’s always $result, so it is here.

Line 4

if (mysql_num_rows($result)==0){

The fourth line is the php version of “if-then”. It simply checks whether there are any results from the query in line 3. The syntax is representative of php coding in general so it’s a good place to start. The curly brackets { } are used to group instructions. The curved brackets ( ) are used for the “if” condition. Everything inside the curly brackets will be executed if the “if” condition is true. PHP uses double equals == for comparison; if I had used only a single equal sign it would try to set mysql_num_rows to 0, which wouldn’t work for our purposes. A missing equal sign is the second thing to look for when your script is hosed and it’s not missing a $ or ;.

Line 5

mysql_query(”insert into counter (pagename,hits) values (’$pagename’,'0′)”); }

Inside the brackets, which only happens when line 4 finds no records of the page we searched for, the instruction creates a new record with the page’s name and zero for the hit count. Although mysql_query is a function, it doesn’t necessarily need a variable $result= in front of it. That’s optional in PHP if you don’t care about the return value.

The closing curly bracket } from the “if” statement comes here, since we only needed one statement to create our record.

Line 6

$count=mysql_result($result, 0, “hits”);

mysql_result fetches the actual data from the result set. You specify the result set (from mysql_query), the row number (0), and the column name (“hits”). This is a little confusing at first since to get here took four steps: 1) log into MySQL, 2) connect to the database, 3) select data from the table, and 4) fetch a particular piece of the data. Putting the repetitive first two steps into an include file where you can more or less forget about them makes it more intuitive: use SQL to select data with mysql_query, and then retrieve data with mysql_result.

Line 7

$count=$count + 1;

Just adds one to the count variable. This is the count of the page views of the page requesting the script.

Line 8

mysql_query (”update counter set hits=$count where pagename=’$pagename’”);

As with Line 5 we send an SQL command directly to MySQL. This one updates the count for just the page matching the variable $pagename.

Line 9

echo “Page Count: “.$count;

The echo function writes text to a web page, in this case the text “Page Count: “ followed by whatever value is in $count. The period in between is the PHP concatenation operator: it simply adds the two strings together. Echo sees it as one string and outputs it.

Details about the connect.php script:

All this script does is connect to the MySQL server and select the Database.

Line 1

$host=”localhost”;$user=”YourUserName”;$password=”YourPassword”;$dbase=”pages”;

These are the inputs for the connect and select_db functions. Naturally you can insert the values into the functions on line 3 and 4 and eliminate this line, but it’s simpler to change later (when you re-use this code for example) if you just list them out at the top. The host and dbase won’t need to be changed in this example. The user and password are specific to your MySQL setup. As shown here you can put as many statements on one line as you want; PHP doesn’t care.

Line 2

// change the user and password to your MySQL user and password

The double slashes // denote a comment line that is ignored by php. Each comment line needs the slashes.

Line 3

$connect = mysql_connect($host,$user,$password);

You log into your MySQL with the mysql_connect command. You would change the host from “localhost” to the database server if you were accessing MySQL from another server, provided you’ve set up the access rights for the specified user/

Line 4

mysql_select_db($dbase,$connect);

Since we can have multiple databases in the MySQL server, we have to select one before sending SQL statements to it. As I mentioned earlier, this part is repetitive, and once it’s in this file and working you can forget about it.

In this tutorial we’ve examined a simple but functional web page counter implemented with PHP/MySQL. We examined the basic syntax of PHP statements and variables, the PHP “include” function and “if” control function, and the fundamental PHP MySQL functions mysql_connect, mysql_select_db, mysql_query, mysql_num_rows, and mysql_result. For further reference the reader should bookmark http://dev.mysql.com/doc/refman/6.0/en/index.html and http://us.php.net/manual/en/funcref.php .

Bill Hamilton is a former Database Administrator for United News and Media, and VNU inc. He currently operates several php/mysql driven websites including Gemstones and Beads