Select Database After we have establish the connection in MySQL server, we have to select a database. To do that we are going to use the mysql_select_db() function. Syntax: mysql_select_db(databasename,connection) Parameter: databasename – the database name you want to use.…
Tag: PHP Syntax
PHP Tutorial – PHP Forms
In this tutorial we are going to learn how to take data entered by the user in an HTML form and process it into PHP script and display the output. We need two pages here namely the process.php and the…
PHP Tutorial – do while loop
The do while loop In do while loop the statements or conditions are executed first then that condition is evaluated, the loop will continue while the condition is true. Syntax: do { code to be executed; } while (condition); Example:…
PHP Tutorial – The while loop
A loop is a block of code that enables you to repeat the same set of statements or commands over and over again; the actual number of repetitions may be dependent on a number you specify. The while loop The…
PHP if…else…if statement
PHP if…else…if statement if…elseif….else statement – use this statement to select one of several blocks of code to be executed. The if…elseif….else statement This statement is used to select one of several blocks of code to be executed. The if..else…
PHP if…else statement
PHP if…else statement if (…else) statement – use this statement if you want to execute a set of code when a condition is true (and another if the condition is not true). The if…else Statement An if statement that includes…
PHP if statement
PHP if statement – this statement is used to execute a specific programming code if a specified condition is true. The if statement Used to execute a specific programming code if a specified condition is true. An if statement can…
PHP String Variable
PHP string variable is variable that is used contains text or characters. In this lesson we are going to learn how to store a string in a variable and use a string directly into a function. Let’s see some example…
PHP Variables
PHP Variables In this lesson we are going to learn how to declare a variable in PHP. A variable is something that can handle a piece of information. Variable in PHP can store values such as text and integers. The…
PHP Tutorial – Learning the PHP Syntax
PHP scripts are enclosed within a start and end tag. PHP scripts are embedded in a HTML document and you can place the PHP codes anywhere in the document. The two forms of PHP scripting block: The shorthand form starts…