hi all,
i am writing this script which searches the given string and displays the results from database, to which i add update and delete urls in front of the each result row, which are meant to perform there respective functions ie on clicking on update url it should take the user to next page and allow the user to update the record while if the user click's on delete url it should allow it to delete that particular record, i want to use mysql_query funtion to do same.
for example, if search for product named "television", it will display the results in following format:
CARS :
BMW $200000.00 update delete
Rolls Royec $500000.00 update delete
follwing is the part of code which is supposed to perform the tasks. plz if any one can help me.
if($myrow = mysql_fetch_row($result))
{
echo '<table width=40% border=0>';
printf("<tr><td align=left valign=middle colspan=2><b><font face=Arial size=4> %s </font></b></td></tr>", $name);
do
{
printf("<tr><td align=right valign=middle><b><font face=Arial size=2> %s </font></b></td><td align=center valign=middle><font face=Arial size=1><a href=\"#\">update</a> <a href=\"<\?php mysql_query(\"DELETE from category where catid='$myrow[0]'\",$db ?>>delete</a></font></td></tr>", $myrow[2]);
}while($myrow = mysql_fetch_row($result));
printf("</table>");
Regards
Piyush