
June 20th, 2009, 07:51 AM
|
|
Contributing User
|
|
Join Date: Jun 2009
Posts: 49
Time spent in forums: 16 h 46 m
Reputation Power: 1
|
|
|
php5 - Mass editing fields from MySQL DB.
Hi,
I'm working on a script to mass edit any number of entries that are stored in DB.
Here's what I've came up with so far.
PHP Code:
if(!$_POST['Potrdi'])
{
$Sql_Kategorije = "SELECT *
FROM Kategorije";
$Poizvedba_Kategorije = mysql_query($Sql_Kategorije);
?>
<form method="post" action="ApKategorije.php?x=Urejanje">
<?PHP
while ($Kategorije = mysql_fetch_array($Poizvedba_Kategorije))
{
echo "<p>Id: " . $Kategorije[Id] . " <input type=text value=$Kategorije[Naziv]></p>";
}
?>
<input type="submit" name="Potrdi" value="Uredi">
</form>
<?PHP
}
else
{
}
Well I get fields with correct entries from DB. But I don't know how to implement an array into this and actually update the table with changes I make in the fields.
If there was a set number of entries then I'd just use $_POST[something] to capture let's say 5-6 different categories. I'm kind of confused right now. I'm stil learning PHP so I bet it's something really easy to do and I'm just missing it.
Thanks for the help in advance.
|