WebDev Masters

Web Development & Webmaster Resources

Browsing Posts tagged Mysql

The recent boom in field of Information Technology has seen a steep rise in the demand of trained professionals in PHP and MySQL. Software companies specializing in php mysql web development are always searching for skilled professionals for recruitment in several important projects. The current supply of PHP experts is much below par, in terms of potential growth in the industry.

To train the educated work force in this regard various MySQL and PHP training courses have been developed. These courses provide elaborate training to the professionals for developing website with the usage of these languages.

PHP Training Objectives

Two main objectives of php and mysql web development program are:

• To develop skills to create interactive and data-driven sites

• Skill development for database creation in MySQL programming

Prerequisites For Training

The most important criteria for acquiring PHP training is thorough knowledge of HTML. The course should focus on any level in programming for teaching database creation.

On the other hand there are courses for fresher in the field of php and mysql web development. Some institutes like Indus Net Academy, has launched ACE Web Developer course with the aim of teaching real applications in PHP and MySQL. These courses are beneficial for creating awareness among candidates about programming language.

Course Details

Once you get enrolled into these training courses you can acquire knowledge in areas like PHP Programming Fundamentals, Strings Functions, Arrays Functions, HTML/CSS and Forms, File Handling and Email Handling in PHP, Object Oriented PHP and Session Handling etc. On the other hand, the ACE Web Developer course emphasizes on other programming languages such as MySQL Basics, Extended PHP, OOPS in PHP 5, Exception handling in PHP 5, XML / SOAP etc.

Another vital aspect of these php mysql development courses are; 70% hands-on and 30% lecture ratio, as far as the training part of the course are concerned. By engaging the students in live projects the courses ensure that the students have a thorough understanding of the actual application of such programming languages.

So if you have some knowledge about HTML, then you can get online training as well as work as a freelancer for php mysql web development. Some of the requirements essential for learning this programming language are:

• A personal computer at home

• Linux, Windows, MacOS X, or Solaris operating system

• Web server (either Apache httpd or Microsoft IIS)

• PHP 5 or later with the PEAR extensions enabled

• MySQL 4.1 or later (5 or later recommended)

• Internet Explorer 6 or Firefox 2

PHP programmers can now get quality work through the Internet from the freelancing websites. It is an open source language and is free to install and use. This is the main reason for the increase in the popularity of this language.

Markus fernandez manages php mysql web development, Ruby on Rails Programming and Development releted articles, RSS feeds and podcasts for www.script2please.com

So you have finally arrived at a stage where you to need to
choose a web host to run your PHP & MySQL supported website.
This means your website is dynamic, that is, it changes
according to the feedback from your visitors or the data your
MySQL database contains.

You may need PHP features in your web hosting for the following
reasons:

[o] YOU NEED TO PROCESS THE WEB FORM USING php

Although there are numerous CGI scripts available (and many
hosts provide these scripts for free), if you can, it is
preferable to get your own script written to meet your specific
requirements. The cgi scripts available at your web host are
very generic in nature. If you have your own PHP script to
handle your form, you can generate your own response when a
visitor submits your form.

There are great many JavaScripts that can help you validate your
forms, but these days many surfers prefer to disable scripts for
the fearing on getting infected with worms and viruses. php
script on the other hand a server-side script and nobody can
stop them from running as long as the browser is loading the web
page.

You can also send a customized “thank you” message to whoever
submits the form. After sending the “thank you” message and
emailing the form details to you, your customized php script can
also save the submitted information in a php database.

[o] MANAGE PRODUCT CATALOGS WITH php & MySql DATABASE

You may like to generate your pages dynamically using data in
your MySQL database. For example, if you want to maintain a
catalog of 150 different wine bags, it would be arduous to
maintain the details manually. Instead you can put information
like price, shape, color, picture path, etc. in a database and
then write a php page that, let us say, shows 10 wine bags at a
time. The visitor thinks she’s visited 15 pages, but there is
only one dynamic page that is sequentially showing the products.

Additionally, if you want your visitors to be able to conduct
searches (just red wine bags) you can upload a php script to
your web host that shows only the wine bags that satisfy the
search criteria.

[o] PUBLISH A BLOG

You may need a PHP/MySQL web host if you are planning to publish
a regular blog.

Most blogging software these days, such as MovableType and
WordPress use php and MySql to generate dynamic content. In
fact, WordPress has been purely written using PHP and MySql so
that people well-versed with the php programming language can
make their own changes.

[o] MANAGE AN E-COMMERCE WEBSITE

Choosing a php / MySql web host is a great way to go if you want
to run an e-commerce website. E-commerce websites indisputably
need dynamic capabilities such as updatable shopping carts and
inventory management systems that can be developed using php and
MySql.

As they say, when it comes to imagination and innovation, the
sky is the limited. A PHP/MySQL web host empowers you to create
as many web-enabled capabilities as you can think of.

ADVANTAGES OF CHOOSING A php / MySql WEB HOST

Advantages of opting for php & MySql web hosting are:

1. php websites, since they are run on Linux and Unix, are
considered more secure compared to Windows supported languages
such as ASP and .NET.

2. Lots of free php source code is available on the Internet.
There are hundreds of forums that readily provide you assistance
while you learn and develop websites in php.

3. Both php and MySql are free from License fees.

4. php & MySql web hosting is much cheaper than Windows
supported hosting

5. Applications written in php are sturdier and easily scalable
to various web hosting environments. Notably, php scripts can be
run on Windows hosting but ASP and .NET apps do not work on
Linux and Unix

Rodel Garcia is a freelance programmer and web developer. Owner
and webmaster of this web hosting
website. For details of this article, please go to PHP /MSQL Web Hosting

What is website hosting with MySQL and why would you want to use it? Simply put, it offers application developers everything they need to be successful in building database-driven information systems. Website hosting with MySQL offers consistent fast performance, high reliability and is very easy to use. It is the most popular open source database in the world and has become the database of choice for applications of Linux, Apache, or PHP.


If you are new to database technology, website hosting with MySQL offers a wide range of certified software and support to make you very successful. It has the ultimate in scalability and capacity to handle deeply entrenched applications of only 1 MB running massive data warehouses holding gigabytes of information.


WEB STRENGTHS AND DATA PROTECTION


This data base software is the standard for high traffic websites because of its high-performance query engine and fast data insert capability. These strengths also apply to data warehousing environments where it scales up into the terabyte range. Because of the open source nature of MySQL, this allows complete customization for those wanting to add exclusive requirements to the database server.


Guarding the data assets of corporations is the number one job of database professionals; website hosting with MySQL offers exceptional security features that ensure absolute data protection. When it comes to database authentication, it also provides powerful mechanisms for ensuring only authorized users have entry to the database server. This ability to block users down to the client machine level becomes possible. A privileged framework is present so that users only see the data they should, and powerful data encryption functions ensure that sensitive data protected from non-permitted viewing.


Finally, backup and recovery utilities provided through website hosting with MySQL and third party software vendors allow for complete logical and physical backup as well as full and point-in-time recovery.


ASP WEBSITE HOSTING – FLEXIBLE, FAST AND POWERFUL


Active Server Pages or ASP in website hosting uses the ASP programming language developed by Microsoft. Even though classic ASP is no longer supported, Microsoft pushes the ASP.NET version for web hosting. ASP.NET is HTML pages with embedded ASP scripts processed on the server before sending the page to the user. This allows for a very fast and powerful web experience.


Web pages displayed on the internet are either static or dynamic. Static pages display information that never changes while dynamic pages can change content automatically. Dynamic, server-side scripting loads changes on the server before sending to the browser. PHP and ASP.NET program languages are examples that use server-side scripting.


ASP.NET – To Use Or Not To Use?


Website hosting with ASP.NET is easy to learn. It is also very flexible and powerful. Designed with less code and more predefined commands it is faster to learn than Classic website hosting ASP. Being a popular programming language, it is easy to find answers to any questions you may have when using ASP.NET hosting. There are many free tutorials on the internet that will help you with building various types of web pages. It also works well with other programming languages such as JavaScript and VBScript.


Even though ASP and ASP.NET are free since they come with Microsoft IIS; Microsoft Windows and a Microsoft IIS server are expensive. Most of the functions and add-ons will cost a lot of money, too.

Juel Moen is author and advisor of the wildly popular information site – Website-Hosting-Advisor

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.

John Dixon is a web developer working through his own company John Dixon Technology. As well as providing web development services, John’s company also provides free open source accounting software written in PHP and MySQL.