On Thursday 08 July 2004 09:19, Louie Miranda might have typed:

>
> 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.
>

> > ###
> > #!/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

Logic error.  You need to specify which row to update.

Start with
ROW=0
for random in `pwgen`
do
let ROW=$ROW+1
echo "update dump set random= '$random' WHERE countid=$ROW"|mysql -uroot 
insert
done

Untested, but a quick check of how to do math in shell will help.

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

Reply via email to