display array then edit contents
Posted: Thu Nov 17, 2005 4:46 am
[Moderator note:] This was moved from Theory & Design to PHP-Code.
hi! i have this code where the results are placed in an array and then i used an text input so that i could edit the contents of that array :
i would just like to know if it is possible? if it is i would put a submit button at the end of the page and it would trigger an update function in mysql.
comments are much appreciated!
thanks!
twigletmac | Please use
hi! i have this code where the results are placed in an array and then i used an text input so that i could edit the contents of that array :
Code: Select all
if ($num_results == 0)
{
echo "No name in the database.";
exit;
}
else
{
for ($i=0; $i < $num_results; $i++)
{
$row = mysql_fetch_array($result);
echo '<p><strong>'.($i+1).'.ClientID: ';
echo htmlspecialchars($row['id']);
$id=htmlspecialchars($row['id']);
echo "<p><a href='http://localhost/ewan2.php?id=$id'>Enter query for this client</a></p>";
echo '<p><strong><br /> Name:';
?>
<input type="text" value="<?php echo $row['name']?>">
<?php
echo htmlspecialchars($row['name']);
echo "</br>-=-=-=-=-=-=-=";
}
}
?>comments are much appreciated!
thanks!
twigletmac | Please use
Code: Select all
tags when posting PHP code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]