How to call a php function within a hyperlink call
Posted: Mon Jun 04, 2007 9:26 pm
feyd | Please use
/* code end here */
Where delete_record is a php function that will delete the record in the SQL table.
So this will generate a table where the last column is only the term "delete" shown where the user can click the delete link to delete the current record in the row.
How do I do that ???
Thank you in advance for your answer.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
I try to do the following but without any success.
/* code start here */Code: Select all
echo '<table>';
while ($row = mysql_fetch_row($result))
{
echo '<tr><td>' . $row[2] . '</td><td>' . $row[1] . '</td><td><a href=\" ' . delete_record($row[1], $row[2]) . ' \">delete</a></td></tr>';
}
echo '</table>';Where delete_record is a php function that will delete the record in the SQL table.
So this will generate a table where the last column is only the term "delete" shown where the user can click the delete link to delete the current record in the row.
How do I do that ???
Thank you in advance for your answer.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]