PHP, MySQL and ASP NET in Web Hosting
Choosing between LINUX web hosting and Windows hosting is a daunting task. You should know the language of your website, before determining which platform or which type of server you need. Linux hosting is best suitable for a simple HTML site or an ecommerce site or a site with any other programming-database feature created in php-MySql. If your site is in ASP, or ASP.NET, then you need to be on Windows servers.
Now what exactly are ASP.NET, PHP and MySQL web hosting? Let us delve further into these terms.
ASP.NET web hosting: Marketed by Microsoft, ASP.NET is a division of Microsoft’s .NET platform and a successor of Active Server Pages (ASP) technology. ASP.NET is a set of Web application development technologies that programmers can use to build dynamic applications, Web sites, and XML Web services.
ASP.NET web hosting cuts down the number of codes and makes building web application much easier. It gives more flexibility to the choice of language by supporting multiple .NET languages. In ASP.NET web hosting, as the source code and HTML are together, the pages are easy to write and maintain. Because of the built-in configuration information, registration of components is not necessary. ASP.NET application is faster and can face a large number of users with a consistency of performance.
PHP web hosting: PHP is a recursive initialism for PHP : Hypertext Preprocessor. PHP is a reflective programming language or a general-purpose server-side scripting language used for web development, i.e. creating dynamic and interactive websites. It can be planted into HTML code. PHP is frequently used together with APACHE on various operating systems mostly LINUX.
PHP acts more like a filter, running on a web server, taking inputs from a stream or file containing text and PHP instructions and displays a different stream of data. PHP is deployable in most operating systems, servers and platforms free of cost.
MySQL web hosting: MySQL is a multi-user, multithreaded computer language designed for management and retrieval of data, database object access control management and database schema creation and modification. It is a SQL database management system with 10 million installations. It is popular for web application, for open-source bug tracking tools and acts as the database component of WAMP, MAMP and LAMP. MySQL is closely related to PHP and Ruby on Rails. Most of the well known sites like Wordpress run on a combination of PHP and MySQL.
Now that you are more familiar with ASP.NET web hosting, PHP and MySQL web hosting, it may prove fruitful in your selection of server type.
Create Dynamic Database Driven CSS Navigation Menus with Dreamweaver, PHP and MySQL
This article will demonstrate an easy way to create dynamic CSS-based navigation menus that allow you to change your website navigation sitewide with one simple MySQL database update. For this example, I will be using the Chrome CSS Drop Down Menu available from Dynamic Drive. It’s a free, lightweight CSS menu that is easily customizable and only uses a small amount of JavaScript. There are other free CSS menus available such as the Suckerfish menu and other commercial menu options are available.
This article assumes the reader is somewhat familiar with Dreamweaver, PHP and MySQL. Powering your navigation menu from a database allows you to easily change your website’s navigation menu simply by updating the database fields that make up the Dreamweaver recordset. Building your site navigation using CSS also allows for quick sitewide changes via the stylesheet formatting.
The first step is to implement the CSS menu of your choice. It’s useful to include several mock menu items as you style your menu so you can see how the menu will appear with multiple navigation choices. Once your menu is in place, go back and delete all but the first menu item in the HTML unordered list.
The second step is to create your MySQL database table which will power your menu. Using the MySQL manager of your choice, create a table which includes three fields: a unique auto-numbering ID field, a field which will hold the text displayed by each menu option, and a hyperlink field, which will include the link each menu item follows when clicked. Depending on your site structure, you can use relative or absolute URLs in this field. At this point, insert data into the database table which will populate the site when loaded. For example, in the first table row, you could have the menu text “HOME” and the URL “index.php”.
Next, back to Dreamweaver to set up the dynamic menu. With your page open, establish a connection to the MySQL database and create the menu recordset. Include all database fields and don’t use any filters on the data. Back in the code, find the first menu item that you left in place earlier. Highlight the text between the quotation marks after the href portion of code. Go into your bindings panel and open the recordset you created for the menu. Click and drag the field representing the link URL field into your code where you highlighted the href link. This will create the PHP code to dynamically assign the link for each menu item. Next, highlight the code in your menu item that will display the browser text for each menu item. Grab the corresponding recordset binding and drag it into your code. This will create the required PHP code that will dynamically display each menu item.
The last step in the process is to create the repeating region that will loop for each database table row. Simply highlight all code from the opening to the closing li tags surrounding the menu item. Go to your server behaviors panel in Dreamweaver and select the “Repeated Region” option. Select the correctrecordset for the menu and click the radio button selecting all records. That completes the dynamic menu creation.
After uploading the page to your testing server, you will see each menu item you entered in your database displayed in your menu. The dynamically generated links will all point to the corresponding pages. If you view the page code, you can see it renders a clean list for the menu items. The code is short and simple and very search engine friendly. For added functionality and the creation of the drop-down menus, simply create a database table that includes the sublinks and include a table field which will hold the parent table ID value. Simply filter by ID for each main menu option, and dynamically generate the submenu the same way you did the main menu. The menu can then be included in a Dreamweaver template for inclusion on every page of your website. When a page is added to the site, simply add the menu item and link in your database and it will appear on every page that includes the navigation menu. It doesn’tget much easier than that to create dynamic database-driven CSS menus.
The author’s Kearney, Nebraska website development company specializes in creating dynamic PHP/MySQL websites for small businesses and organizations.
Article Source: http://EzineArticles.com/?expert=Ryan_Grabenstein
Simple MySQL Connection Testing Script
If you run MySQL dependent applications, you have probably hit this scenario at some stage. You’re trying to install some software that requires MySQL and are using the correct details; but a MySQL connection can’t be made.
Your hosting service says the problem is in the installation routine of the software, the software author says it’s your hosting service – and back and forth you go between host and vendor until someone finally accepts responsibility and fixes the issue. A lot of time can be wasted, and time is money; not to mention the great deal of frustration that can occur.
There’s a simple script for testing connectivity that should help settle the issue. Here’s what to do:
1. Check your hosting account control interface to ensure that the database is present and you have a user set up for that database. Also ensure you have the right password for the db.
2. Create an empty file with a text editor and save it as mysqltest.php
3. Add the following to that file:
Replace hostname (usually localhost), username and password with the details you have for your database. There’s no need to add the database name.
4. Upload to your server to a folder that’s viewable via a browser.
5. Load the file in your browser
If a connection is made, the resulting page will display ‘Connection OK’. Talk again with the software vendor and give them the URL to the script.
If a connection cannot be made, then you’ll probably see something like:
Warning: mysql_connect(): Access denied for user ‘dbuser’@'localhost’ (using password: YES) in /path/to/mysqltest.php on line 2 Could not connect to MySQL: Access denied for user ‘dbuser’@'localhost’ (using password: YES)
Copy and paste that error and send it to your web host, along with the details of your database.
Don’t forget to remove the file once the issue is settled.
PHP Book Review
If I ask you what is the most famous and widely used web development language, what will your answer be? If you answered PHP, then you’re absolutely right. Now, if I ask you what is the most easiest server-side language to learn and pick up quickly, then the answer is again PHP. That’s right! PHP along with MySQL allows you to develop complex database driven sites without having a degree in computer science
Learning PHP is not as hard you might think. There are tons of books on PHP and the one I’m going to talk about today is the only book you need to start building PHP and MySQL applications.
“Build Your Own Database Driven Website Using PHP & MySQL” is designed to take you through step-by-step coding process of building complex database driven websites and help you enhance your skills in PHP and MySQL development.
Here is what you will learn in this book…
Installing PHP and MySQL
“Build Your Own Database Driven Website Using PHP & MySQL” starts of by helping you install PHP and MySQL on Windows, Linux or MAC. There is one section devoted to installing PHP and MySQL on each platform with trouble-shooting tips.
Getting Started with MySQL
In the 2nd chapter you will take your first steps into creating MySQL databases, tables, and inserting, deleting and updating data from your database.
Getting Started with PHP
The 3rd chapter basically gives you a whole tour of PHP. You will learn common programming fundamentals like, strings, variables, conditional statements, looping and much more. Who said you need a college degree to lean how to code?
Publishing MySQL Data on the Web
In the fourth chapter you will learn how to retrieve data form your newly created database and display it onto a page. This is fun chapter where you will create a small script to insert, delete and publish data from database to your PHP page.