Theres some more info if you need itsub cart_settings { $id = param('id'); $sth = $dbh->prepare("SELECT id,name,parent,description,view_cats_pro +d FROM category WHERE id = '$id'"); $sth->execute or die $dbh->errstr; ($ided,$name,$parent,$des,$view) = $sth->fetchrow_array; print qq~ <input type="hidden" name="id" value="$id"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="110" bgcolor="#CCCCCC" align="center" class="da +rktext"> Category</td> <td bgcolor="#CCCCCC" class="text"> <input type="text" name="cat" value="$name" maxlength="255"> </td> </tr> <tr> <td width="110" bgcolor="#CCCCCC" class="darktext" align=" +center"> Short Description</td> <td bgcolor="#CCCCCC" class="darktext"> <input type="text" name="des" value="$des" maxlength="25 +5"> </td> </tr> <tr> <td width="110" bgcolor="#CCCCCC" class="darktext" align=" +right"> ~; if($view eq "yes") { print qq~ <input type="checkbox" name="page" value="yes" CHECKED> ~; } else { print qq~ <input type="checkbox" name="page" value="yes"> ~; } print qq~ </td> <td bgcolor="#CCCCCC" class="darktext"> Have all of the categories products on this page </td> </tr> <tr> <td bgcolor="#CCCCCC"></td> <td bgcolor="#CCCCCC" class="darktext" align="center"><inp +ut type="submit" name="cart" value="Update Settings"></td> </tr> </table> ~; } sub cart_upsettings { $id = param('id'); if(! param('cat') || ! param('des')) { inerror("You didn't enter a category or description"); } $cat = param('cat'); $des = param('des'); if(param('page') eq "yes") { $dbh->do("UPDATE category SET name='$cat' AND view_cats_prod='yes +' AND description='$des' WHERE id='$id'") or die $dbh->errstr; } else { $dbh->do("UPDATE category SET name='$cat' AND view_cats_prod='no' + AND description='$des' WHERE id='$id'") or die $dbh->errstr; } print qq~ <p>$cat, settings has been updated</p> ~; if($id) { print "<a href=\"admin.cgi?cart=cat&id=$id\">Return to Manage Categ +ories</a>"; } else { print "<a href=\"admin.cgi?cart=cat\">Return to Manage Categories</ +a>"; } }
In reply to Re: Re: Re: Re: Somethings not rightwith my MySQL do()
by andrew
in thread Somethings not rightwith my MySQL do()
by andrew
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |