mysql4u.com


MS SQL / MySQL - A Case Study

Posted in Mysql Books by mysql4u on the August 27th, 2007

The release of Microsoft SQL Server 2005 on November 7th 2005 created a buzz around the office for IT professionals. The use of SQL server by businesses as in an in house data server has become increasingly more popular, this same popularity is now beginning to shift to the web hosting industry.

With the release of MS SQL 2005 Microsoft had this to say “Microsoft SQL Server 2005 provides an integrated data management and analysis platform that helps organizations reliably manage mission-critical information and confidently run complex business applications. With embedded reporting and data analysis tools included with SQL Server 2005, companies can gain greater insight from their business information.” The norm for hosting companies has forever been mySQL. mySQL is a free license database server which has an easy to use php based interface called phpmyadmin.

The difference in these two database platforms has become more apparent since the release of MS SQL 2005. We will look at two website hosting companies one of which offers only mySQL on a windows server (http://www.6squared.com) and one which offers both a mySQL and MS SQL 2005 database to its customers (http://www.fivecubed.com)

It is very difficult to make a performance comparison between SQL Server 2005 and MySQL version 4.1. The performance of your databases depends upon the experience of the database developers and database administrator rather than the database’s provider. You can use both of these RDBMS to build stable and efficient systems. It is also possible to define typical transactions used in inventory control systems such as airline reservation systems and banking systems. After defining these typical transactions, it is possible to run them under the different database management systems working with different hardware and software platforms.

The comparison aspect being looked at here is how the two web hosting companies sell their hosting packages and which company in turn produced a greater number of sales based on its database offerings. Fivecubed.com who offers MSSQL anteed up a large amount of money to host MSSQL for its customers in the hopes that more customers would use the service solely for the MSSQL. The break-even point for Fivecubed.com was $8,000 because they purchased the MSSQL 2005 standard edition processor specific. This puts 6squared.com at a huge advantage over fivecubed.com.

Both companies offer hosting for all price levels and incorporate a large array of features, which puts them on a somewhat even playing field if marketing is ignored. Fivecubed.com and 6squared.com were studied over a period of 1 month. The results of their sales from the period beginning November 7th, and Ending December 7th were as follows: Fivecubed.com had new sales of only database additions (not including hosting packages without database access) totaling 189 sales which translates into $2,632. The databases are sold based on two criteria size and quantity. 6squared.com offered its databases free during this one-month period and generated no additional revenue from database sales. This puts 6squared.com ahead of fivecubed.com by $5,368 at the end of one month by not purchasing MS SQL server.

Now for a projection of sales by fivecubed.com’s finance department. They determined a growth rate of 10% per month for the next 24 months. At the end of this time the total number of databases sold will equal 1,692.36, which translates into $13,538.88. As long as these forecasts hold fivecubed.com will reach its break even point by the 18th month and will turn a profit on the 19th month.

The demand for MSSQL shown in the first month that fivecubed.com implemented it was enough to create a profit after only 18 months.

Functions and Subroutines in ASP

Posted in MySql Tutorial by mysql4u on the August 27th, 2007

Functions and Subroutines in ASP
If you read our Tutorial on Include Files (SSI) then you learned how to encapsulate ASP code within include files and the benefits it brings us.

As developers, we should endeavour to make our lives easier wherever possible… no one wants to re-invent the wheel after all.

Functions and Subroutines exist to not only save us time, but to bring power to our ASP.

They are just another way of encapsulating code, but have a lot more functionality than just ’saving some code for later’.

First, let’s look at Functions… Imagine a balloon salesman in the street. We’ve all seen them they require one piece of information when you buy a balloon, the colour.
Let say we asked for a red balloon… The balloon salesman armed with this ‘information’ then does a pretty basic action… he hands you the balloon. The balloon you received is a direct result of the information you gave the balloon seller.

Functions are just the same… they return to you a value based on the information you provided. Lets look at an example Function: -

<%
Function getBalloon(strColour)

Dim Tempstr

strColour = lcase(strColour) 'This converts the value lowercase.
Select Case strColour

Case "red" Tempstr = "Here is your red balloon"

Case "yellow" Tempstr = "Here is your yellow balloon"

Case "green" Tempstr = "Here is your green balloon"

Case "blue" Tempstr = "Here is your blue balloon"

Case Else Tempstr = "Sorry, we have sold out of that Colour"
End Select

getBalloon = Tempstr
End Function
%>
A Function is passed some information. The information we pass a Function, is known as an ‘argument’. The information we get back from a Function is known as the ‘return value’. Whilst a Function can have many arguments, it can only have one return value.

Let us look at one more example: -

<%
Function calcTax(amount, taxrate)

Dim Tempvar

Tempvar = amount * (taxrate / 100)

CalcTax = Round(Tempvar, 2) 'round the result to 2 decimal places
End Function
%>
Again, another basic example. We should notice this time that the Function accepts two arguments.

By now, we have some idea of how to write a Function. How do we use one?
Let me show you now how we can use the calcTax example.

<%
shoppingbill=goodsTotal + calcTax(goodsTotal,17.5)
Response.Write "Your shopping came to £" & goodsTotal
Response.Write "
VAT amount = £" & calcTax(goodsTotal)
Response.Write "Total Amount Due = £" & shoppingbill
%>
Above you see the example function in action… easy huh!

I have tried to make understanding Functions as easy as possible… Understanding a Subroutine (Sub) is now going to be easy for you. Imagine a block of code that performed some instructions based on information you gave it…
Sounds very much like a function, doesn?t it? Well this time, we do not get anything back. A sub does NOT pass back information it just uses the data we give it for some purpose.

I will use only one example of a Sub, and in the same example make use of the sub: -

<%
Sub Bday(strName, intAge)

Response.Write "Happy Birthday " & Name

Response.Write ", You are " & intAge & " years old today"
End Sub

'now, call the sub
bDay "Joe",26
%>
The above Sub, demonstrates my point. We put something in, it performs an action (in this case writing to the screen), but nothing is returned to us in the code. One thing that REALLY IS important when using a sub, is that we do not put brackets around the arguments… Because we do not have a return value we do not need brackets and in this case, if we try we will get an error.

Well, that just about concludes this article. We should by now be writing efficient code with the use of Functions and Subs. Don?t forget that if you use your functions and subs in multiple pages then you should really store them within include files for reasons of easy maintenance and better performance.

Ecommerce for Beginners

Posted in MySql Tutorial by mysql4u on the August 27th, 2007

Like most average persons, I wanted some extra money to supplement my regular income. I had considered a part time second job at times, but hated that option because it would take me away from the family, make me more tired and probably just pay minimum wage. I also wanted to be able to work from home.

I had surfed the internet for years and had often considered the idea of participating in the internet revolution. I had read some statistics on the use of internet and the increasing numbers of homes with computers and the increasing percentage of Christmas shopping done over the internet. So I decided to jump in with both feet.

First what is ecommerce? The online world designates web sites devoted to retail sales as an e-commerce site. E-commerce sites sell either information or hard goods such as cameras or knifes. E-commerce sites also have Shopping Carts and Payment Gateways attached to them that non-sales web sites do not need.

Ok……so you want to develop an E-commerce site. You are now probably asking do I have enough skill, mental patience or aptitude to be successful?

Well if you have average intelligence, I believe that you and thousands of people just like you could have an E-commerce web site. All that is required is the willingness to learn a few things, patience, and the determination to apply yourself.

How? I am glad you asked.

Let’s begin. We first need to discuss the basics components you will need.

1. Computer 2. Internet connection 3. Site building software 4. Graphics Software 5. Web hosting company 6. Shopping cart 7. Payment gateway

The above elements are where most people stop when they think of what they will need when they want to start an ecommerce site. However, there are other elements that need to be considered, such as getting legal and product sourcing.

Items 1 and 2 above are pretty straight forward and most people can understand why they are necessary. The other items however are a little more complex. Site building software allows the beginner to construct a web site without knowing html programming code. What is Html programming Code?

Html is the programming language of the internet and stands for Hyper Text Mark Up Language. The two best software programs currently available to write Html are Microsoft’s FrontPage 2003 or Macromedia’s Dreamweaver. These programs are more correctly known as HTML Editors.

These two programs are the best ones available. I have them both but use FrontPage 2003 primarily. I think FrontPage 2003 is easier to use and does better tables then Dreamweaver. Most professional web site developers, however consider Dreamweaver the better of the two because some claim it has more features, but I find it is a little more complicated to use. I would recommend that you surf the internet and read the reviews on both of these programs and make you own choice.

Next you will need a good graphic program such as Adobe Photoshop 6. A graphics program allows you manipulate the size of images create images in different formats and create special effects. “PhotoShop 6” is the current version from Adobe and is the best software program for graphics. Adobe “Photoshop Elements” can also be used, but is a limited version of the full Photoshop software. The programs from Adobe are expensive so shop around for the best price.

Web hosting is very important and you need to comparison shop for features first, not on price. Web hosting and ecommerce are extremely related, and learned by personal experience the mistake trying to separate ecommerce from web hosting. The web host company is the company that rents room on their server for your web site, but they can much more. They can offer an integrated shopping cart.

The shopping cart is the heart of the ecommerce web site. The shopping cart for all intents and purposes runs your ecommerce web site so it is critical to get a good one. It contains and displays the products you intend to sell. It also does other neat administrative functions that will make your store easier to run. There are some stand alone shopping carts for sale but most come with web hosting service attached.

The “Payment Gateway” is the cashier in the store and is also known as a “Merchant Account.” This is basically a business credit card account. The payment gateway allows your se store to accept credit cards and transfer money to you. Merchant Accounts are very important and you should also carefully review their services and prices. If you do not get a merchant account you are pretty much limited to papal. Search the web and check out the available shopping carts and payment gateways.

Now what are you going to sell, and where are you going to get it? You can look every where for the products you want to sell. How do you know what will sell well? You need to do some market research. Not everything sells well, including electronics. If you have no preference on what to sell, find some marketing software that will allow you to determine which products ell well online.

Next, you will need a source for those products. Assuming you are not making them yourself. The best way is to drop ship them. The trouble is finding a reliable drop ship source and avoiding the imposters.

Once you find you product source you need to open an account and stock your store and start selling. There munch more to an ecommerce store then can be explained in a brief article format. As someone who recently went from zero to an online store Cynscorion.com), I know first hand of the pit falls that await the beginning ecommerce site builder.

If you want to learn more about what to avoid in building an ecommerce site go to either: www.cynscorion.com and go to the bottom of the page and click on “Ecommerce Book For Beginners” ,or go to: http://cynscorion.com/store/cart.php?page=what_yofuture_release_of_a_very_unique_ecommerce_book This book is for people undecided on whether to start an ecommerce site and want to find one point of reference to assist them in making their decision.

Lastly, I wish you good luck and success in your ecommerce endeavors. If I can do it, so can you!

Programming PHP

Posted in PHP Mysql Books by mysql4u on the August 12th, 2007




PHP is far more than a cult language or open-source icon. It’s a remarkably capable language that’s well integrated with lots of technologies–notably mSQL and MySQL database servers–and quite easy to learn. Programming PHP helps you up the PHP learning curve, very nearly guaranteeing that you’ll find in its pages an example that illustrates every fundamental aspect of the language and its most important extension modules. Plus, there’s some cool advanced stuff, like recipes for manipulating images, working with Extensible Markup Language (XML) content, and generating Adobe Acrobat (PDF) files. Rasmus Lerdorf invented PHP and quarterbacks its ongoing evolution, so there’s little question of the content’s authority.

The authors use a Talmudic style to explore PHP’s capabilities and explain them to their readers, meaning that they like to present code and commentary in close formation, with each enhancing the other. Typically, they’ll present a capability generically and show the relevant code. Then they’ll dig into variations on the theme, calling attention to required code alterations as they go. This is a book about PHP itself, so practically no attention is paid to PHP Builder or other development tools. Regardless, this book will help you solve programming challenges with PHP, and enable you to write efficient, attractive code. –David Wall

Topics covered: The PHP programming language, for people who are coming to PHP with a bit of programming experience in other languages or who want to expand their existing PHP knowledge beyond the basics. Sections deal with the core language, as well as HTTP session management, database connectivity (to MySQL and Oracle, as well as with PHP Extension and Application Repository–PEAR), graphics file manipulation, XML parsing, and PDF creation. There are instructions for building a PHP extension library in C, as well as a function reference and guide to existing extensions. –This text refers to the Paperback edition.

Book Description

Programming PHP, 2nd Edition, is the authoritative guide to PHP 5 and is filled with the unique knowledge of the creator of PHP (Rasmus Lerdorf) and other PHP experts. When it comes to creating websites, the PHP scripting language is truly a red-hot property. In fact, PHP is currently used on more than 19 million websites, surpassing Microsoft’s ASP .NET technology in popularity. Programmers love its flexibility and speed; designers love its accessibility and convenience.

As the industry standard book on PHP, all of the essentials are covered in a clear and concise manner. Language syntax and programming techniques are coupled with numerous examples that illustrate both correct usage and common idioms. With style tips and practical programming advice, this book will help you become not just a PHP programmer, but a good PHP programmer. Programming PHP, Second Edition covers everything you need to know to create effective web applications with PHP. Contents include:

* Detailed information on the basics of the PHP language, including data types, variables, operators, and flow control statements
* Chapters outlining the basics of functions, strings, arrays, and objects
* Coverage of common PHP web application techniques, such as form processing and validation, session tracking, and cookies
* Material on interacting with relational databases, such as MySQL and Oracle, using the database-independent PEAR DB library and the new PDO Library
* Chapters that show you how to generate dynamic images, create PDF files, and parse XML files with PHP
* Advanced topics, such as creating secure scripts, error handling, performance tuning, and writing your own C language extensions to PHP
* A handy quick reference to all the core functions in PHP and all the standard extensions that ship with PHP

« Previous PageNext Page »