Posts

Showing posts from January, 2020

UNIT II---WORKING WITH ARRAYS AND FUNCTIONS

WORKING WITH ARRAYS   Arrays  are collections of related values.   such as the data submitted from a form, the names of students in a class, or the populations of a list of cities.. EXAMPLE You can create an array using the array() function, like this: <? php $array = array ();   ?> ARRAY DEFINITION  An array is a data structure that stores one or more similar type of values in a single value. If you wish, you may send the desired new elements of the array along as a parameter.      * Numeric array      * Associative array          * Multidimensional array NUMERIC ARRAY  These arrays can store numbers, strings and any object but their index will be represented by numbers. By default array index starts from zero. Syntax array (Value1, Value2, ValueN ); Example  <? php      $subject = array...

UNIT II---FLOW CONTROL FUNCTION IN PHP

FLOW CONTROL FUNCTION IN PHP PHP supports a number of traditional programming constructs for controlling the flow of execution of a program. ž Example   if ($ user_validated )   echo “Welcome!”; Else Echo “Access Forbidden “; SWITCHING FLOW  ž Most scripts evaluate conditions and change their behavior accordingly. ž The capability to make decisions makes your  PHP pages dynamic, able to change their output according to circumstances. Example  <? php $favcolor =  "red" ; switch  ($favcolor)   {      case   "red" :          echo   "Your favorite color is red!" ;              break ;         case   "blue" :          echo   "Your favorite color is blue!" ;              break ; ...

UNIT1---INTRODUCTION TO MYSQL

MYSQL INTRODUCTION — MySQL is an open source, fast reliable, and flexible relational database management system, used with PHP. — MySQL is a fast, easy-to-use RDBMS being used for many small and big businesses. — MySQL is developed, marketed and supported by MySQL AB, which is a Swedish company.  MYSQL DATA TYPES — BIT. — CHAR. — DATETIME. — DECIMAL. — ENUM. — JSON. — TIME. — TIMESTAMP. CREATE A MYSQL TABLE — A database table has its own unique name and consists of columns and rows. — The CREATE TABLE statement is used to create a table in MySQL . Ex: CREATE TABLE MyGuests ( id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, email VARCHAR(50), reg_date TIMESTAMP ) INSERT DATA INTO MYSQL — After a database and a table have been created, we can start adding data in them. Here are some syntax rules to follow: — String values inside the SQL   query must ...

UNIT 1 ----PHP LANGUAGE STRUCUTURE

THE STRUCTURE OF A PHP  <? php echo "<p>Hello World!</p>";   ?> • The PHP tags enclose only one statement    an  echo  statement.   • The echo statement is a PHP statement that you’ll use frequently. • The output is simply the text that’s included between the double quotes. BUILDING BLOCK OF PHP ž PHP  supports a number of f undamental basic data types , such as integers, floats, and strings. Basic data types are the simplest  building blocks  of a program. ž Note:  PHP statements end with a semicolon (;).     BASIC PHP SYNTAX — A PHP script can be placed anywhere in the document. A PHP script starts with  <? php   and ends with  ?> : ?php // PHP code goes here ?> — The default file extension for PHP files is ". php". COMMENTS IN PHP — A comment in PHP code is a line that is not read/executed a...