26375How to connect to MySQL database using PHPhttp://www.webcheatsheet.com/php/connect_mysql_database.phpLet's get started. The first thing to do is connect to the database.The function to connect to MySQL is called mysql_connect. This function returns a resource which is a pointer to the database connection. It's also called a database handle, and we'll use it in later functions. Don't forget to replace your connection details.PHP > Tips and Tutorials > Introduction to PHPOct 15, 2006WebCheatSheet
Before creating a php application or website you will first need to check if PHP is supported by your Web Hosting Provider. In other words your webhost will need to have PHP installed on the webserver were your site is housed.
Strings are probably what you will use most in your PHP script. From concatenating, looking for patterns, trim, chop etc. So I guess it's a good idea to take a better look at this creature. We will also take a peek at some string functions that you might find useful for everyday coding.
Ok, so from the prototype above, we can see the function explode() (a function is denoted by the () after the name as this is where you put any parameters) will create an array (oh the joy):
In an earlier tutorial, I described how to define variables as numbers. Basically you chose a variable name, for this example lets chose ?$number?, and you chose a value, we?ll use 15. The code could then be written as shown below.
Joining mailing list will entitle you
to receive occasional emails informing you of news and
updates to the site and any special offers that may be
of interest to you.