April 20, 201214 yr good morning how i can active edit link when i click on it dispay all row information by pid virible and wen cilck on button save the change .. see my code in attachment <? extract($_GET); //connect to mysql if (!($dbc=mysql_connect("localhost","root",""))) die("could not connect to database "); //select database $db_selected = mysql_select_db("ehsan",$dbc); if(!$db_selected) { die("cannt connect "); } $query= mysql_query("select `id`,`product_name`,`price`,`category`,`detail`,`picture`,`date_addd` FROM `product` "); if(isset($id)) { $queryid= mysql_query("select id, product_name,price,category,detail,picture,date_addd FROM product WHERE id = '$id'"); $rowid =mysql_fetch_row($queryid); } else{ $productlist="no items"; } ?> <? extract($_GET); // delete from DB if (!($dbc=mysql_connect("localhost","root",""))) die("could not connect to database "); //select database $db_selected = mysql_select_db("ehsan",$dbc); if(!$db_selected) { die("cannt connect "); } if(isset($deleteid)){ $dquery=mysql_query("DELETE FROM `product` WHERE `id`='$deleteid'") ; if(!($result=mysql_query($dquery))) { print"the item was deleted seccsessfly "; die (mysql_error()); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>add items </title> <style type="text/css"> .title { color: #0C6; background-color: #666; border: thin dotted #000; position: relative; text-align: right; } </style> </head> <body> <div> <p> </p> <p> </p> <p> </p> </div> <div><h1>store list</h1> <p> <?php //get info from title from DB and print it; while($row =mysql_fetch_row($query)) { print(" $row[0] $row[1]- <a href='mange.php?pid=$row[0]'>edit</a>•<a href='mange.php?deleteid=$row[0]'>delete</a><br/>"); ?> <? } ?> </p> </div> <form id="form1" name="form1" method="post" action="conection.php"> <table width="513" border="1"> <tr> <td width="92">product name</td> <td width="405"> <input type="text" name="product_name" id="textfield2" /></td> </tr> <tr> <td>product price</td> <td><input type="text" name="price" id="textfield2" /></td> </tr> <tr> <td>category</td> <td><select name ="category"> <option>book</option> <option>electorinc </option> <option>clothing</option> </select> </td> </tr> <tr> <td>product datails</td> <td><textarea name="detail"rows=5 ></textarea></td> </tr> <tr> <td>product image </td> <td><input type="file" name="picture" /><input type="hidden" name= "upload" ></td> </tr> <tr> <td></td> <td><input type="submit" name="button" value="add this item " /></td> </tr> <tr> <td height="128"> </td> <td> </td> </tr> </table> </form> </body> </html>
April 20, 201214 yr You're going to have to ask your question in English; I don't have the faintest clue what you said.
April 20, 201214 yr Author THANK U FOR REPLY I want to activate the edit link to update info When I click on the link showing all the information stored in databases in EACH input text then when click on submit button save change in DB I WONT TO MAKE LIKE THIS VIDEO
Create an account or sign in to comment