Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I wouldn't recommend running it on an active table, but testing it in a throwaway table is reasonably easy. From the mysql commandline client (using mysql 4.0 )
mysql> create database pmtest; Query OK, 1 row affected (0.09 sec) mysql> use pmtest; Database changed mysql> create table t (id smallint, count smallint, time datetime); + Query OK, 0 rows affected (0.01 sec) mysql> insert into t values (1,1,now()); Query OK, 1 row affected (0.00 sec) mysql> insert into t values (2,1,now()); Query OK, 1 row affected (0.00 sec) mysql> insert into t values (3,1,now()); Query OK, 1 row affected (0.00 sec) mysql> update t set count=count+1, time=now() where id=2; Query OK, 1 row affected (0.02 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> update t set count=count+1, time=now() where id=2; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> select * from t; +------+-------+---------------------+ | id | count | time | +------+-------+---------------------+ | 1 | 1 | 2007-02-22 19:26:39 | | 2 | 3 | 2007-02-22 19:27:06 | | 3 | 1 | 2007-02-22 19:26:45 | +------+-------+---------------------+ 3 rows in set (0.01 sec)

In reply to Re^3: Updating a mysql row - testing with a throwaway table by imp
in thread Updating a mysql row by Anonymous Monk

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
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 lurking in the Monastery: (4)
As of 2024-04-20 02:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found