Tuesday 30 May 2017

Basic code of DELETE DATA USING MYSQL IN PHP

HOW TO CREAT DELETE DATA USING MYSQL IN PHP


<head>
<?php
mysql_connect("localhost","root","");
mysql_select_db("exam");

if(isset($_REQUEST['del'])){
$id = $_REQUEST['del'];
$delete = " delete from result where id = '$id' ";
$q = mysql_query ($delete);
};
$qr = " select * from  result";
$rs = mysql_query($qr);
$num= mysql_num_rows($rs);
?>
</head>

<body>

<table border="1">
<tr>
   <td>name</td>
   <td>last name</td>
   <td>father's name</td>
   <td>email</td>
   <td>password</td>
   <td>phone</td>
   <td>gender</td>
   <td>address</td>
   <td>nationality</td>
   <td>country</td>
   <td>delete</td>
</tr>

 <?php 
 if ($num > 0){
 while($row = mysql_fetch_array($rs)){
 
 ?>
      <tr>
          <td> <?php  echo $row['name']; ?> </td>
           
          <td> <?php  echo $row['lastname']; ?></td>
           <td><?php  echo $row['father']; ?></td>
           <td> <?php  echo $row['email']; ?> </td>
           <td><?php  echo $row['password']; ?></td>
           <td><?php  echo $row['phone']; ?></td>
           <td> <?php  echo $row['gender']; ?> </td>
           <td><?php  echo $row['address']; ?></td>
           <td> <?php  echo $row['nationality']; ?> </td>
           <td> <?php  echo $row['country']; ?> </td>
           <td><a href="exam select delete.php?del=<?php echo $row['id'];?>"> delete</a> </td>
           </tr>
           <?php }}  ?> 
             
</table>

</body>

Saturday 27 May 2017

the importent theory of CSS

A style sheet language, or style language, is a computer language that expresses the presentation of structured documents. One attractive feature of structured documents is that the content can be reused in many contexts and presented in various ways. Different style sheets can be attached to the logical structure to produce different presentations.

One modern style sheet language with widespread use is Cascading Style Sheets (CSS), which is used to style documents written in HTML, XHTML and other markup languages.

For content in structured documents to be presented, a set of stylistic rules – describing, for example, colors, fonts and layout – must be applied. A collection of stylistic rules is called a style sheet. Style sheets in the form of written documents have a long history of use by editors and typographers to ensure consistency of presentation, spelling and punctuation. In electronic publishing, style sheet languages are mostly used in the context of visual presentation rather than spelling and punctuation.

Example CSS
To make all paragraphs on a page blue and sized 20% bigger than normal text, we would apply this CSS rule to a page:

p {
Full form of css

  color: blue;
  font-size: 120%;
}

<div style="float:right; border:thin solid green;">
Here comes a short paragraph that is<br />
contained in a "div" element that is<br />
floated to the right.
</div>

All style sheet languages support some kind of formatting model. Most style sheet languages have a visual formatting model that describes, in some detail, how text and other content is laid out in the final presentation. For example, the CSS formatting model specifies that block-level elements (of which "h1" is an example) extend to fill the width of the parent element. Some style sheet languages also have an aural formatting model.

Click here for more knowledge


the most important Flowchart of php

PHP for loop can be used to traverse set of code for the specified number of times.

It should be used if number of iteration is known otherwise use while loop.

Syntax

for(initialization; condition; increment/decrement){  

//code to be executed  

}  

Flowchart

php for php for loop flowchartloop flowchart

Example

<?php  

for($n=1;$n<=10;$n++){  

echo "$n<br/>";  

}  

?>