mysql - How to solve Notice: Undefined index: id in C:\xampp\htdocs\invmgt\manufactured_goods\change.php on line 21 -
mysql - How to solve Notice: Undefined index: id in C:\xampp\htdocs\invmgt\manufactured_goods\change.php on line 21 -
this question has reply here:
php: “notice: undefined variable” , “notice: undefined index” 14 answersi have problem php code saying "notice: undefined index" sure simple, since beginner not getting wrong please help me.
here's code
<?php require_once('../connections/itemconn.php'); ?> <?php $id=$_get['id']; $query=mysql_query("select * manuf id='$id' ")or die(mysql_error()); $row=mysql_fetch_array($query); ?> <form action="updateprice.php" method="post" enctype="multipart/form-data"> <table align="center"> <tr> <td> <label><strong>item name</strong></label></td> <td> <label> <?php echo $row['itemname']; ?></label><input type="hidden" name="id" value="<?php echo $id; ?> " /> <br /></td> </tr> <tr> <td><label><strong>unit cost </strong></label></td> <td> <input type="text" name="pass" value="<?php echo $row['unitprice']; ?> " /><br /></td> </tr> <tr> <td> <input type="reset" name="reset" value="cancel" /> <br></td> <td> <input type="submit" name="submit2" value="update" /> </td> </tr> </table> </form> </body> </html>
you not getting value of $id=$_get['id'];
so, please update line to:
$id = isset($_get['id']) ? $_get['id'] : ''; php mysql
Comments
Post a Comment