07 Php Mysql Update Delete

43 %
57 %
Information about 07 Php Mysql Update Delete
Technology

Published on June 27, 2009

Author: geshan

Source: slideshare.net

Description

PHP MYSQL update and delete.

PHP Day 07 Geshan Manandhar Developer, Young Innovations Private Limited www.geshanmanandhar.com http://www.php.net http://www.mysql.com

List Users with actions (detail, edit, delete)

How to code the actions column Inside while ($row= mysql_fetch_array($user_records) loop $user_id = $row['user_id']; $user_table .= &quot;<td>&quot;; //line no. 56 – day07show_users_with_actions.php $user_table .= &quot;<a href=&quot;user_detail.php?id=$user_id&quot;>Detail</a> - &quot;; $user_table .= &quot;<a href=&quot;user_edit.php?id=$user_id&quot;>Edit</a> - &quot;; $user_table .= &quot;<a href=&quot;user_delete.php?id=$user_id&quot;&quot;; $user_table .= ' onclick=&quot;javascript:return confirm('Do you really want to delete?');&quot;'; $user_table .= &quot;>Delete</a> - &quot;; $user_table .= &quot;</td> &quot;;

Inside while ($row= mysql_fetch_array($user_records) loop

$user_id = $row['user_id'];

$user_table .= &quot;<td>&quot;; //line no. 56 – day07show_users_with_actions.php

$user_table .= &quot;<a href=&quot;user_detail.php?id=$user_id&quot;>Detail</a> - &quot;;

$user_table .= &quot;<a href=&quot;user_edit.php?id=$user_id&quot;>Edit</a> - &quot;;

$user_table .= &quot;<a href=&quot;user_delete.php?id=$user_id&quot;&quot;;

$user_table .= ' onclick=&quot;javascript:return confirm('Do you really want to delete?');&quot;';

$user_table .= &quot;>Delete</a> - &quot;;

$user_table .= &quot;</td> &quot;;

User Detail

Show user table construction code

Output of user_detail.php?id=X

Update User. Form is a combination of prog46_user_reg.php and user_detail.php. user_edit.php is a form with values of the user_id passed via the URL. Check out the code at day07user_edit.php It also needs a variable called id to be passed vai the URL making the URL look something like: http://localhost/php_class/day07/user_edit.php?id=5

Form is a combination of prog46_user_reg.php and user_detail.php.

user_edit.php is a form with values of the user_id passed via the URL.

Check out the code at day07user_edit.php

It also needs a variable called id to be passed vai the URL making the URL look something like: http://localhost/php_class/day07/user_edit.php?id=5

Output of User Update form

Edit user the function

Delete User In every delete call always confirm the delete operation, preferably with javascript. Similar to user_detail but this operation deletes the record from the database. Usage of parameter via URL and fetched in $_GET variable. Full code at: day07user_delete.php

In every delete call always confirm the delete operation, preferably with javascript.

Similar to user_detail but this operation deletes the record from the database.

Usage of parameter via URL and fetched in $_GET variable.

Full code at: day07user_delete.php

Delete user function code

CRUD done That sums up the regular Create Read Update Delete (CRUD) operations. The common and most used operation in any database focused application. Other things like search, sorting etc are enhanced form or Read/Retrieve. Things to do: some sorting and join queries for tables.

That sums up the regular Create Read Update Delete (CRUD) operations.

The common and most used operation in any database focused application.

Other things like search, sorting etc are enhanced form or Read/Retrieve.

Things to do: some sorting and join queries for tables.

Questions

Assignment Create a user management system with picture upload, the database only stores the filename. (keep in mind file should not be over-written in case of same filename). Let there be option for type of user “Admin”, “Super User” or “Normal User”. Perform CRUD operations on your login system.

Create a user management system with picture upload, the database only stores the filename. (keep in mind file should not be over-written in case of same filename).

Let there be option for type of user “Admin”, “Super User” or “Normal User”.

Perform CRUD operations on your login system.

Add a comment

Related presentations

Presentación que realice en el Evento Nacional de Gobierno Abierto, realizado los ...

In this presentation we will describe our experience developing with a highly dyna...

Presentation to the LITA Forum 7th November 2014 Albuquerque, NM

Un recorrido por los cambios que nos generará el wearabletech en el futuro

Um paralelo entre as novidades & mercado em Wearable Computing e Tecnologias Assis...

Microsoft finally joins the smartwatch and fitness tracker game by introducing the...

Related pages

MySQL:’ - 0100100001101001 ! | informatikZentrale

MySQL:’ (UPDATE’ (ALTER (DELETE (DROPTABLE. ... DELETE LöschenvonDaten DELETE FROM tabellenname löschtsämtliche’Datensätze’einer’Tabelle. ...
Read more

07 PHP MYSQL Update Delete - scribd.com

PHP Day 07. http://www.php.net ... delete) GeshanManandhar.com 2 How to code the actions column Inside while ($row= mysql_fetch_array($user_records) loop ...
Read more

07 PHP MYSQL Update Delete - pt.scribd.com

PHP Day 07. http://www.php.net ... delete) GeshanManandhar.com 2 How to code the actions column Inside while ($row= mysql_fetch_array($user_records) loop ...
Read more

MySQL Befehle - unsere ersten Gehversuche - PHP Kurs

MySQL Befehle, select insert update delete mit php ... Read more

PHP and Mysql select, insert, update and delete Part1 ...

PHP and Mysql select, insert, update and delete This tutorial for creating ... 07 PHP and Mysql ... PHP mysql insert update delete and Display ...
Read more

Mysql UPDATE speichert nicht - php.de

Mysql UPDATE speichert nicht 05.02 ... INSERT und DELETE funktioniert aber. ... Hier sollte PHP eine Fehlermeldung ausgeben, ...
Read more

Tutorial PHP + MySQL - INSERT, DELETE, UPDATE ... - YouTube

Tutorial PHP + MySQL - INSERT, DELETE, UPDATE, ... PHP mysql insert update delete and Display image part 1 ... INSERT, UPDATE, DELETE - Duration ...
Read more

INSERT – Daten einfügen - MySQL

Read more

PHP: mysqli::$affected_rows - Manual

... , UPDATE-,REPLACE- oder DELETE-Abfrage ... $appointment_date = "2015-12-07"; $sql = "update appointments ... (checked on MySQL 5.0.85 linux and php 5.2 ...
Read more

SQL DELETE FROM - 1Keydata SQL-Tutorial

Dies können wir mit dem Befehl DELETE FROM erreichen. ... 07.Jan.1999: Los Angeles: 300: 08.Jan.1999: ... SQL UPDATE; SQL DELETE FROM ;
Read more