Posts

database connectivity in php

Image
 First Create a database using phpmyadmin 1 create database using database table only type database name and then click create 2 then type the table name  eg. users 3 then select the value of which you want and then click go button eg. crname, name, age, salary 4 then select the insert button on the top of the section and insert values on the created values  database connection using php data.php <?php $servername  =  "localhost" ; $username  =  "root" ; $password  =  "" ; $database  =  "phpsample" ; // creating database connection  $conn  =  mysqli_connect ( $servername , $username , $password , $database ); // check connection if (! $conn ){      die ( "Failed to connect" .  mysqli_connect_error ()); } else {      echo   "connection successful" .  "<br>" ; } //insert command queary $sql  =  " I...

PHP get and post method

Image
 form.php <! DOCTYPE   html > < html   lang = "en" > < head >      < meta   charset = "UTF-8" >      < meta   http-equiv = "X-UA-Compatible"   content = "IE=edge" >      < meta   name = "viewport"   content = "width=device-width, initial-scale=1.0" >      < title > Document </ title > </ head > < body >      < form   action = "ac.php"   method = "post" >         Name:  < input   type = "text"   name = "nm"   id = "" >< br >         Email Id:  < input   type = "email"   name = "em"   id = "" >< br >          < input   type = "submit"   value = "Submit" >   ...

Php basic

Image
First.php Basic of php  <! DOCTYPE   html > < html   lang = "en" > < head >      < meta   charset = "UTF-8" >      < meta   http-equiv = "X-UA-Compatible"   content = "IE=edge" >      < meta   name = "viewport"   content = "width=device-width, initial-scale=1.0" >      < title > Document </ title > </ head > < body >      <?php      define ( "pi" , 3.14 );      echo   "hello world <br>" ;      $a  =  123 ;      $b  =  4 ;      $str1  =  "this is a string <br>" ;      var_dump (( $str1 ));  //calculate number of variable      echo   $str1 ; ...