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 answers

i 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

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

SQL Server : need assitance parsing delimted data and returning a long concatenated string -