Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
nothings working im going to go crazy god.
sub 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>"; } }
Theres some more info if you need it

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Domain Nodelet?
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this?Last hourOther CB clients
    Other Users?
    Others examining the Monastery: (4)
    As of 2025-06-24 04:40 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?
      erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.