test0123
Patch Validation Expert
2
MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1
200 XP
If you are looking for on How To Create Multiple Update/Delete Data Using PHP then you are at the right place. We all know about on how to update data and deleting data one by one. In this article, we can update and delete data in the selecting rows that you want.
To select multiple rows to update and deleting data, we used a checkbox to select the multiple data.
Form Field - Multiple SelectEdit Data
This source code that the user can edit their multiple data in the rows.
And, it will look like.
To select multiple data.
To edit multiple data.
To delete multiple data.
Share us your thoughts and comments below. Thank you so much for dropping by and reading this tutorial post. For more updates, don’t hesitate and feel free to visit this website more often and please share this with your friends or email me at [email protected]. Practice Coding. Thank you very much.
Download
To select multiple rows to update and deleting data, we used a checkbox to select the multiple data.
Form Field - Multiple SelectEdit Data
This source code that the user can edit their multiple data in the rows.
- <form
name
=
"frmUser"
method
=
"post"
action
=
""
>
- <table
border
=
"0"
cellpadding
=
"10"
cellspacing
=
"0"
width
=
"500"
align
=
"center"
>
- <tr
class
=
"tableheader"
>
- <td
>
Edit User</
td
>
- </
tr
>
- <?php
- $rowCount =
count(
$_POST[
"users"
]
)
;
- for
(
$i=
0
;$i<$rowCount;$i++)
{
- $result =
mysql_query(
"SELECT * FROM users WHERE userId='"
. $_POST[
"users"
]
[
$i]
. "'"
)
;
- $row[
$i]
=
mysql_fetch_array(
$result)
;
- ?>
- <tr
>
- <td
>
- <table
border
=
"0"
cellpadding
=
"10"
cellspacing
=
"0"
width
=
"500"
align
=
"center"
class
=
"tblSaveForm"
>
- <tr
>
- <td
><label
>
Username</
label
></
td
>
- <td
><input
type
=
"hidden"
name
=
"userId[]"
class
=
"txtField"
value
=
"<?php echo $row[$i]['userId']; ?>
"><input
type
=
"text"
name
=
"userName[]"
class
=
"txtField"
value
=
"<?php echo $row[$i]['userName']; ?>
"></
td
>
- </
tr
>
- <tr
>
- <td
><label
>
Password</
label
></
td
>
- <td
><input
type
=
"password"
name
=
"password[]"
class
=
"txtField"
value
=
"<?php echo $row[$i]['password']; ?>
"></
td
>
- </
tr
>
- <td
><label
>
First Name</
label
></
td
>
- <td
><input
type
=
"text"
name
=
"firstName[]"
class
=
"txtField"
value
=
"<?php echo $row[$i]['firstName']; ?>
"></
td
>
- </
tr
>
- <td
><label
>
Last Name</
label
></
td
>
- <td
><input
type
=
"text"
name
=
"lastName[]"
class
=
"txtField"
value
=
"<?php echo $row[$i]['lastName']; ?>
"></
td
>
- </
tr
>
- </
table
>
- </
td
>
- </
tr
>
- <?php
- }
- ?>
- <tr
>
- <td
colspan
=
"2"
>
- <input
type
=
"submit"
name
=
"submit"
value
=
"Update"
class
=
"btnSubmit"
>
- <a
href
=
"index.php"
><input
type
=
"button"
value
=
"Cancel"
class
=
"btnSubmit"
></
a
>
- </
td
>
- </
tr
>
- </
table
>
- </
form
>
And, it will look like.
To select multiple data.

To edit multiple data.

To delete multiple data.

Share us your thoughts and comments below. Thank you so much for dropping by and reading this tutorial post. For more updates, don’t hesitate and feel free to visit this website more often and please share this with your friends or email me at [email protected]. Practice Coding. Thank you very much.
Download
You must upgrade your account or reply in the thread to view the hidden content.