Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Updating a mysql row - testing with a throwaway table

by imp (Priest)
on Feb 22, 2007 at 23:27 UTC ( #601660=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Updating a mysql row
in thread Updating a mysql row

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)


Comment on Re^3: Updating a mysql row - testing with a throwaway table
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://601660]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2014-07-29 02:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls