April 23, 201214 yr who can find my error this code for update does not work i think the error in query i get this message Notice: Undefined variable: detail in C:\xampp\htdocs\database\mange.php on line 156 /////////////////////////////////////////////////////////////////////////////////////////////// //update <? if(isset($pid)){ $uquery= mysql_query("update product SET product_name=`$product_name`,price=`$price`,category=`$category`,detail=`$detail`,picture=`$picture` WHERE id = `$pid`"); while($row = mysql_fetch_array($query)){ $product_name=$row[1]; $price=$row[2]; $category=$row[3]; $productdetail_name=$row[4]; $picture=$row[5]; } ?> <form id="form2" name="form2" method="get" action="mange.php"> <table width="593" border="1" align="right"> <tr> <td width="92">product name</td> <td width="369"> <input type="text" name="product_name"value="<? echo $price;?>" id="textfield2" /></td> </tr> <tr> <td>product price</td> <td><input type="text" name="price"value="<? echo $price;?>" id="textfield2" /></td> </tr> <tr> <td>category</td> <td><select name ="category"> <option>"<? echo $detail;?>"</option> <option>book</option> <option>electorinc </option> <option>clothing</option> </select> </td> </tr> <tr> <td>product datails</td> <td><textarea name="detail"rows=5 value="<? echo $detail;?>"></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="update " /></td> </tr> <tr> <td height="128"> </td> <td> </td> </tr> </table> </form> <? } ?>
April 23, 201214 yr $[color="#FF0000"][b]uquery[/b][/color]= mysql_query("update product SET .... "); while($row = mysql_fetch_array($[color="#FF0000"][b]query[/b][/color])){ I'd guess that is causing the problem. On a side note, why on earth are you trying to fetch a MySQL update query? You already have all the variables you get from the query, you just sent them to the DB... Edited April 23, 201214 yr by Spitfire
Create an account or sign in to comment