Here it is in details :
1st page :I have a table with 4 columns (isbn, author, title, price). All the data of that table are showing from db(by while loop). Now i want to edit and delete those data one by one. These edit & delete option are side by side for each data of that table like :
isbn author title price
1 -- bika -- ctg -- 12 edit delete
2 -- mika -- cog --18 edit delete
3 -- nika -- cbg -- 14 edit delete
when i click on "edit" one of them (for here isbn 1) it takes me an another table of another page with a form containing that particular information. like:
author : mika
title : ctg
price : 12
with a button "done".
After editing existing information when i click done, the edited information will store in db.
In normal php code it works and the code is :
1st page:
Code: Select all
<table border="1">
<?php
if(isset($_POST['submit']))
{
$order = "UPDATE books SET author='$_POST[author]', title='$_POST[title]', price='$_POST[price]' WHERE isbn='$_POST[isbn]'";
mysql_query($order) or die (mysql_error());
}
$order = "SELECT * FROM books ORDER BY author" or die (mysql_error());
$result = mysql_query($order);
while ($row=mysql_fetch_array($result))
{
echo ("<tr>
<td>$row[isbn]</td>
<td>$row[author]</td>
<td>$row[title]</td>
<td>$row[price]</td>
<td> <a href=\"editdata_form.php?isbn=$row[isbn]\"> Edit </a> </td>
<td> <a href=\"delete.php?isbn=$row[isbn]\"> Delete </a> </td>
</tr>");
}
?>
</table>
Code: Select all
<table>
<?php
$order = "SELECT * FROM books where isbn=$_GET[isbn]";
$result = mysql_query($order);
$row = mysql_fetch_array($result);
?>
<form method="post" action="editordeletedata.php">
<input type="hidden" name="isbn" value="<?php echo "$row[isbn]"?>">
<tr>
<td>Author</td>
<td>
<input type="text" name="author" size="40" value="<?php echo "$row[author]"?>">
</td>
</tr>
<tr>
<td>Title</td>
<td>
<input type="text" name="title" size="40" value="<?php echo "$row[title]"?>">
</td>
</tr>
<tr>
<td>Price</td>
<td>
<input type="text" name="price" size="40" value="<?php echo "$row[price]"?>">
</td>
</tr>
<tr>
<td align="right">
<input type="submit" name="submit" value="Done">
</td>
</tr>
</form>
</table>
Code: Select all
<a href=\"**editdata_form.php**?isbn=$row[isbn]\"> Edit </a> </td>
Code: Select all
<a href=\"**index.php?option=com_content&view=article&id=18&Itemid=18**?isbn=$row[isbn]\"> Edit </a> </td>
I think the isbn=$row[isbn] cannot send the data to the action "article link page", If anyone have any idea or solution please share with me.
Thanks a lot in advance.
chech this url : http://lhfiberathome.net/index.php?opti ... &Itemid=17