/    Sign up×
Community /Pin to ProfileBookmark

Multiple Update Table/Form Thing?

I’m not sure exactly what this would be called- but I would like to create a single HTML form for multiple record updating. Like the “browse” function in phpMyAdmin, where it lists multiple records on a table with input fields and then updates them all at once.

I’m imagining that each record would have a unique ID, and that each dataset would somehow turn into an array- but how do you get an array from an HTML form?

I Imagine the first page would look like:

[code=php]
function ListCategories()
{
$Q = “SELECT * FROM Categories”;

$R = SafeQuery($Q, true);

if(mysql_num_rows($R) == 0)
{
$Out = “No rows”;
return $Out;

}
else
{
$Table = “<form><table>”;

$Table .= “<tr>”;

$Table .= “<td>&nbsp;</td>”;
$Table .= “<td>ID</td>”;
$Table .= “<td>Name</td>”;
$Table .= “<td>Order</td>”;

$Table .= “</tr>”;

while($W = mysql_fetch_array($R))
{
$Table .= “<tr>”;

$Table .= “<td><input type=’checkbox’ ></td>”;
$Table .= “<td>” . $W[‘CategoryID’] . “</td>”;

$Table .= “<td><input type=’text’ value='” . $W[‘CategoryName’] . “‘></td>”;
$Table .= “<td><input type=’text’ value='” . $W[‘CategoryOrder’] . “‘</td>”;

$Table .= “</tr>”;
}

$Table .= “</table></form>”;
}
return $Table;
}
[/code]

But how does the receiving script work? Or what is this even called (so I can search for tutorials)?

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @lightnb spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...