SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Sep 2010
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    INSERT Random numbers into a table

    Hi Folks,

    I have a tabel I use to collect customer reviews.

    Aside form a few other fields the back bone are the 'id' and 'password' fields. Which are printed on cards for users to access the review area in order to input their reviews.
    I set up the table originally with 10,000 rows, each with the id auto incremented and with a random eight character password. Now those 10,000 rows have been used.

    So I need to add another 10,000 rows to the table with a password for each. So here's my question:

    Is there a way I can add 10,000 rows to the table AND generate an automatic password for each one as it is set up using SQL?

    Any ideas?

    Dave

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,248
    Mentioned
    59 Post(s)
    Tagged
    3 Thread(s)
    why can't you generate the next batch of random passwords the same way you generated the first batch?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Zealot
    Join Date
    Sep 2010
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I could but that would mean exporting the table as a csv file pasting in the passwords in excel, saving the file as a csv and then reimporting it.
    Just thought if there was a way to avoid all of that and the potential hiccups that could occur it would be good.

    When i first imported the table it only had password in it but now it would have all the text form the existing review sin it and it could get messy.

    As you can gather I'm no expert when it comes to MySQL.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •