Edit Records in Database using PHP_SELF problem......help...

Dear All:

I have a list of records on table. when user click on the hypertext. A edit page will open and fill with the details records user selected.

the script as below(categorylist.php):

[php]
while ($row = mysql_fetch_assoc($result)) {
echo ‘’;
echo $row[“id”];
}
[/php]

and the dsp_editcategory.php(edit page)

[php]

<?php $var = $_REQUEST['cat_id']; if ($update){ $sql_updatecat ="UPDATE category SET description ='$var'"; } ?>

        Category:<?php echo $var?>    

        Description:

        

[/php]

when I click on the hypertext link error prompt as below:

Notice: Undefined variable: update in c:inetpubwwwroothomelegancedsp_editcategory.php on line 34;
at this statement “if ($update){”.

Anybody can help me on this?

Thank You[/b]

Change

if ($update)

to

if (isset($_POST[‘update’]))

That should do it.

:)
Sponsor our Newsletter | Privacy Policy | Terms of Service