Jump to content

update problem


williamh69

Recommended Posts

hi guys i cant edit my data... what is my error

<?php
// get value of id that sent from address bar

$menu_id=$_GET['menu_id'];
// Retrieve data from database
$sql="SELECT * FROM menus WHERE menu_id='$menu_id'";
$result=mysql_query($sql);

$rows=mysql_fetch_array($result)
?>


<table width="400" border="0" cellspacing="1" cellpadding="0">
<tr>
<form name="form1" method="post" action="update_ac.php">
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td> </td>
<td colspan="3"><strong>Update data in mysql</strong> </td>
</tr>
<tr>
<td align="center"> </td>
<td align="center"> </td>
<td align="center"> </td>
<td align="center"> </td>
</tr>
<tr>
<td align="center"> </td>
<td align="center"><strong>Menu name</strong></td>
</tr>
<tr>
<td> </td>
<td align="center">
<input name="menu_name" type="text" id="menu_name" value="<? echo $rows['menu_name']; ?>">
</td>



<td> </td>

<td align="center">
<input type="submit" name="Submit" value="Submit">
</td>
<td> </td>
</tr>
</table>
</td>
</form>
</tr>
</table>

<?php
// close connection
mysql_close();
?>

error said:_

notice: Undefined index: menu_id in C:\wamp\www\sparklenshine2\admin\edit.inc.php on line 4

 

the tablet

is:

 

menu_id | menu_name

 

Link to comment
https://forums.phpfreaks.com/topic/288308-update-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.