Btw, here are the sample database i have.

mysql> select * from dump;
+---------+----------+----------+
| countid | random   | name     |
+---------+----------+----------+
|       1 | theeyahs | randpass |
|       2 | ciuwaise | randpass |
|       3 | ciuwaise | randpass |
|       4 | ciuwaise | randpass |
|       5 | ciuwaise | randpass |
|       6 | ciuwaise | randpass |
|       7 | ciuwaise | randpass |
|       8 | ciuwaise | randpass |
|       9 | ciuwaise | randpass |
|      10 | ciuwaise | randpass |
+---------+----------+----------+
10 rows in set (0.01 sec)

mysql>

As you can see, it updates the whole "random" field on the table. What
i would like to do is, update each and everyone of it. using a random
program, which i have. Its on my first email.



On Thu, 8 Jul 2004 16:18:06 +0800, Louie Miranda <[EMAIL PROTECTED]> wrote:
> Im trying to work on a program that can update each field and insert a
> random value on it. But when i run this program it only updates the
> whole random field.
> 
> Can anyone help me? Im pretty clueless how to work this right. :/
> 
> ###
> #!/bin/sh -x
> for random in `pwgen --no-capitalize -N1`
> do
> sleep 0
> done
> 
> echo $random
> 
> for update in $random
> do
> echo "update dump set random= '$random' limit 1"|mysql -uroot insert
> done
> 
> ## end of script ###
> 
> --
> Louie Miranda
> http://www.axishift.com
> 


-- 
Louie Miranda
http://www.axishift.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to