SlideShare a Scribd company logo
View Edit Delete
View Data<?phprequire_once ('../../mysql/mysql_connect.php'); 	$query = "SELECT * FROM   Tablename	";$result = mysql_query ($query);$row = mysql_fetch_array ($result, MYSQL_ASSOC);echo '<table cellspacing="2" cellpadding="2">';echo '<table border="0" cellspacing="3" cellpadding="3" align="center"><tr><td align="left" width=""><b>Name</b></td></tr>';// Display all the URLs.$result = mysql_query ($query);$total = mysql_num_rows ($result);while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) {	// Display each record.echo "<tr></tr>";echo "<td align=left><a href=\"cooperator.php?coop=".$row['id']."\">{$row['name']}</font></td></td>";echo "<td align=left><a href=\"edit-coop.php?coop_id=".$row['id']."\">Edit</font></td>";} // End of while loop.echo "<tr></tr>";echo "<td align=\"left\"><b>$total</b></font></td>	";echo '</table>'; // Close the table.*/mysql_close(); // Close the database connection.?>
View Single Data<?phprequire_once ('../../mysql/mysql_connect.php'); if (is_numeric ($_GET['coop'])) { // Make sure there's a print ID.$query = "SELECT *  	          FROM   Table_name";	$result = mysql_query ($query);	$row = mysql_fetch_array ($result, MYSQL_ASSOC);mysql_close(); // Close the database connection.} else { // Redirect	//header ("Location:  http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php");	exit("No Cooperator Id is Present");}   	echo "<TABLE> ";	echo "<TR ><TD>{$row['last_name']}</td>";	echo "</TABLE>";?>
Edit<?phprequire_once ('../../mysql/mysql_connect.php');    $coop_id = $_GET['coop_id'];   if(isset($_POST['submit']))  {first_name= $_POST['first_name'];         $result = mysql_query("UPDATE table SET first_name='$first_name'",$connect);          echo "The Cooperator has been UPDATED Successfully!";		  }elseif($id){$result = mysql_query("SELECT * FROM table WHERE coop_id='$id' ",$connect);        while($myrow = mysql_fetch_assoc($result))             {$first_name = $_POST["first_name"];?>
Edit Cont.<h3 align="center">Edit <? echo $myrow['first_name']?> <? echo $myrow['last_name']?> Information</h3><form method="post" action="<?php echo $PHP_SELF ?>"><input type="hidden" name="coop_id" value="<? echo $myrow['coop_id']?>"><table width="760" border="0" align="center">  <tr>    <td>First Name</td>    <td><input name="first_name" size="40" maxlength="255" value="<? echo $myrow['first_name']?>" /></td>  </tr>  <tr>    <td> </td>    <td><input type="submit" name="submit" value="Update Information" /></td>  </tr></table></form><?              }//end of while loop			  }//end else?>
Delete<?phprequire_once ('../../mysql/mysql_connect.php'); 	$id = $_GET[‘name_id'];	$result = mysql_query("DELETE FROM table  WHERE name_id=$id");	echo 'Record has been deleted';?>

More Related Content

PDF
Η ΓΛΩΣΣΑ C - ΜΑΘΗΜΑ 12 (ΕΚΤΥΠΩΣΗ)
Dimitris Psounis
 
PPT
Pertemuan 8 - Report Tabel
Adi Triyatmoko
 
PDF
Templating WordPress
Konstantin Kovshenin
 
PDF
Sumahexavector
jbersosa
 
DOCX
Un juego creado en php
Erwin Lobo
 
PDF
The evil consequences of fornication and adultery
Caller To Islam / الداعية الإسلامي
 
PDF
Simple flat ui css accordion
Samsury Blog
 
PPT
databaseapplication.ppt
webhostingguy
 
Η ΓΛΩΣΣΑ C - ΜΑΘΗΜΑ 12 (ΕΚΤΥΠΩΣΗ)
Dimitris Psounis
 
Pertemuan 8 - Report Tabel
Adi Triyatmoko
 
Templating WordPress
Konstantin Kovshenin
 
Sumahexavector
jbersosa
 
Un juego creado en php
Erwin Lobo
 
The evil consequences of fornication and adultery
Caller To Islam / الداعية الإسلامي
 
Simple flat ui css accordion
Samsury Blog
 
databaseapplication.ppt
webhostingguy
 

What's hot (18)

PDF
Doa karnival kantin
Ali Abu Hafiiy Supandi
 
DOCX
Simular un next del recordset en php de forma rudimentaria
jbersosa
 
PDF
Teacher's Film Tells Story about So. Amboy Explosion (The Suburban)
Jacqueline Durett
 
PDF
Add tag shortcode
Peter Baylies
 
PDF
Crea un tema compatibile con le ultime novità WordPress
SkillsAndMore
 
PDF
Cuestionario de capacidades y dificultades
Pediatria_DANO_HPHM
 
PDF
Introdução a python módulo c
Jader Gabriel
 
DOCX
Freddy,teto,chino,jhovany
Arturo Morales Ruiz
 
PDF
040 enllac poligonal
slegna3
 
PPT
Управление отображением материалов с помощью Display Suite. Илья Станкевич.
DrupalCampDN
 
PDF
Php & mysql
ola98z
 
PPTX
14. add in db
Razvan Raducanu, PhD
 
PPTX
Introdução ext js 4
Bruno Tavares
 
PPTX
Visual keyboard와 tomcat설치 및 이클립스 동기화
Lay Sukmin Lim
 
PDF
Contes 66pdf
anatole21
 
PPTX
Silex. Микрофреймворк для микроприложений
Softline
 
PDF
Certificado Pearson
H Reyes-Medina
 
PDF
Elección de licencia addsensor018 manual_netlabel
ireneund
 
Doa karnival kantin
Ali Abu Hafiiy Supandi
 
Simular un next del recordset en php de forma rudimentaria
jbersosa
 
Teacher's Film Tells Story about So. Amboy Explosion (The Suburban)
Jacqueline Durett
 
Add tag shortcode
Peter Baylies
 
Crea un tema compatibile con le ultime novità WordPress
SkillsAndMore
 
Cuestionario de capacidades y dificultades
Pediatria_DANO_HPHM
 
Introdução a python módulo c
Jader Gabriel
 
Freddy,teto,chino,jhovany
Arturo Morales Ruiz
 
040 enllac poligonal
slegna3
 
Управление отображением материалов с помощью Display Suite. Илья Станкевич.
DrupalCampDN
 
Php & mysql
ola98z
 
14. add in db
Razvan Raducanu, PhD
 
Introdução ext js 4
Bruno Tavares
 
Visual keyboard와 tomcat설치 및 이클립스 동기화
Lay Sukmin Lim
 
Contes 66pdf
anatole21
 
Silex. Микрофреймворк для микроприложений
Softline
 
Certificado Pearson
H Reyes-Medina
 
Elección de licencia addsensor018 manual_netlabel
ireneund
 
Ad

Viewers also liked (8)

PPT
PHP - Introduction to PHP Forms
Vibrant Technologies & Computers
 
PPTX
Web server scripting - Using a form
John Robinson
 
PPT
Chapter 07 php forms handling
Dhani Ahmad
 
PPTX
3 php forms
hello8421
 
PPTX
Php Form
lotlot
 
ODP
Form Processing In Php
Harit Kothari
 
PPT
Php forms
Anne Lee
 
PDF
Login and Registration form using oop in php
herat university
 
PHP - Introduction to PHP Forms
Vibrant Technologies & Computers
 
Web server scripting - Using a form
John Robinson
 
Chapter 07 php forms handling
Dhani Ahmad
 
3 php forms
hello8421
 
Php Form
lotlot
 
Form Processing In Php
Harit Kothari
 
Php forms
Anne Lee
 
Login and Registration form using oop in php
herat university
 
Ad

More from lotlot (10)

PPTX
Pseudocode-Flowchart
lotlot
 
PPTX
Mysql Aggregate
lotlot
 
PPTX
Mysql Script
lotlot
 
PPTX
Mysql
lotlot
 
PPTX
Php Loop
lotlot
 
PPTX
Php Condition Flow
lotlot
 
PPTX
Php-Continuation
lotlot
 
PPT
Hariyali - India
lotlot
 
PPTX
The Province Of Davao Oriental
lotlot
 
PPTX
Annual Review
lotlot
 
Pseudocode-Flowchart
lotlot
 
Mysql Aggregate
lotlot
 
Mysql Script
lotlot
 
Mysql
lotlot
 
Php Loop
lotlot
 
Php Condition Flow
lotlot
 
Php-Continuation
lotlot
 
Hariyali - India
lotlot
 
The Province Of Davao Oriental
lotlot
 
Annual Review
lotlot
 

Form Script

  • 2. View Data<?phprequire_once ('../../mysql/mysql_connect.php'); $query = "SELECT * FROM Tablename ";$result = mysql_query ($query);$row = mysql_fetch_array ($result, MYSQL_ASSOC);echo '<table cellspacing="2" cellpadding="2">';echo '<table border="0" cellspacing="3" cellpadding="3" align="center"><tr><td align="left" width=""><b>Name</b></td></tr>';// Display all the URLs.$result = mysql_query ($query);$total = mysql_num_rows ($result);while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) { // Display each record.echo "<tr></tr>";echo "<td align=left><a href=\"cooperator.php?coop=".$row['id']."\">{$row['name']}</font></td></td>";echo "<td align=left><a href=\"edit-coop.php?coop_id=".$row['id']."\">Edit</font></td>";} // End of while loop.echo "<tr></tr>";echo "<td align=\"left\"><b>$total</b></font></td> ";echo '</table>'; // Close the table.*/mysql_close(); // Close the database connection.?>
  • 3. View Single Data<?phprequire_once ('../../mysql/mysql_connect.php'); if (is_numeric ($_GET['coop'])) { // Make sure there's a print ID.$query = "SELECT * FROM Table_name"; $result = mysql_query ($query); $row = mysql_fetch_array ($result, MYSQL_ASSOC);mysql_close(); // Close the database connection.} else { // Redirect //header ("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php"); exit("No Cooperator Id is Present");} echo "<TABLE> "; echo "<TR ><TD>{$row['last_name']}</td>"; echo "</TABLE>";?>
  • 4. Edit<?phprequire_once ('../../mysql/mysql_connect.php'); $coop_id = $_GET['coop_id']; if(isset($_POST['submit'])) {first_name= $_POST['first_name']; $result = mysql_query("UPDATE table SET first_name='$first_name'",$connect); echo "The Cooperator has been UPDATED Successfully!"; }elseif($id){$result = mysql_query("SELECT * FROM table WHERE coop_id='$id' ",$connect); while($myrow = mysql_fetch_assoc($result)) {$first_name = $_POST["first_name"];?>
  • 5. Edit Cont.<h3 align="center">Edit <? echo $myrow['first_name']?> <? echo $myrow['last_name']?> Information</h3><form method="post" action="<?php echo $PHP_SELF ?>"><input type="hidden" name="coop_id" value="<? echo $myrow['coop_id']?>"><table width="760" border="0" align="center"> <tr> <td>First Name</td> <td><input name="first_name" size="40" maxlength="255" value="<? echo $myrow['first_name']?>" /></td> </tr> <tr> <td> </td> <td><input type="submit" name="submit" value="Update Information" /></td> </tr></table></form><? }//end of while loop }//end else?>
  • 6. Delete<?phprequire_once ('../../mysql/mysql_connect.php'); $id = $_GET[‘name_id']; $result = mysql_query("DELETE FROM table WHERE name_id=$id"); echo 'Record has been deleted';?>