WmZilla - Webmaster and Marketplace

The Next Generation Webmaster and Trade Forum

How to do an UPDATE in the database for multiple data?

Chrism13

New member

0

0%

Status

Offline

Posts

42

Likes

0

Rep

0

Bits

220

3

Months of Service

0%
In the table "galeri_resim" in the database, there are rows with IDs like "1, 2, 3, ...". I want to edit the data in these rows using an HTML form in the admin panel. Afterwards, I want to send the edited form to my save.php page and process it in the database. While I can successfully perform this process for a single ID, for example, I am unable to do it for ID 4 (only one is being saved). Can you help me with this? The code I use for writing to the database is as follows:

```
if ($_GET['islem'] == "fotodegistir") {
include "../include/ayarlar.php";

if ($_POST["fotodegistir"]) {
mysql_query("
UPDATE galeri_resim
SET g_id = '" . mysql_real_escape_string(stripslashes($_POST["g_id"])) . "',
baslik = '" . mysql_real_escape_string(stripslashes($_POST["baslik"])) . "',
bilgi = '" . mysql_real_escape_string(stripslashes($_POST["bilgi"])) . "',
sira = '" . mysql_real_escape_string(stripslashes($_POST["sira"])) . "'
WHERE id ='" . $_POST["foto_id"] . "'
");
}
}
```
 

249

6,622

6,642

Top