473,320 Members | 1,600 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to seperate values and place in array

anfetienne
424 256MB
hi,

this is quite a simple question....I have generated 2000 passwords for an ebook, and i want to place them all into a database so that when a person purchases the ebook they are then lead to a page where they have to confirm their email address and will then be shown a password for the ebook. the passwords are called at random from a db.

instead of putting them in one by one i want to just copy and paste them (seperated by commas) into one textarea that once i submit the form php will seperate them by the commas and place them in an array to put into the database

what is the best method to do this? can someone point me in the right direction
Oct 8 '09 #1
3 2642
Atli
5,058 Expert 4TB
Hey.

Why do you generate the passwords ahead of time? Why not just create a random password when the user purchases the ebook and add it to the database then?

Or, better yet, have the user choose his own password.

Anyways, if you have a comma-separated list of strings, you can use explode to split them into an array, and then implode to re-assemble them.

A MySQL query to insert multiple values into a field should be:
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO `table`(`field`) VALUES('val1'), ('val2'), ('valN');
Oct 8 '09 #2
anfetienne
424 256MB
im generating the passwords before hand because the passwords have to be including when the ebook is compiled.....this is just a means to get the password to the person that buys the ebook.

unfortunately there is no other way to do it with the security features of ebook compilers.
Oct 8 '09 #3
Dormilich
8,658 Expert Mod 8TB
@anfetienne
if you connect to your DB with a MySQL client, you can can bypass forms and PHP, for most clients support direct SQL execution.
Oct 8 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: TonyB | last post by:
Hi, I've searched the group and need more information and guidance on this issue I need to resolve next week. I work for the local school system and I am working on a way to parse a CSV file of...
1
by: Sue Adams | last post by:
I have a form on an asp page and am trying to write the code to place the values of all checkboxes that have been selected, into an array. The checkbox values will be used in a dynamic sql statement...
3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
4
by: JeffM | last post by:
Quick C# question: I have comma delimited values in a string array that I want to pass to seperate variables. Any tips on splitting the array? Thanks in advance! JM
1
by: dandorey1 | last post by:
I'm currently in the process of writing a realtime telephony application. I've designed it with a fairly simply plugin architecture. When I first started reading about this the general suggestion...
23
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
4
by: noddy | last post by:
I have a mysql table called Users The userID field values start at 100 and increment up from there I am trying to transfer values from this table into a javascript array Here is what the code...
2
by: blitzztriger | last post by:
Hello!! how do i insert values into mysql , after parsing a submiting textbox?? I made the arrays, so this should be a basic insertion of them in the db, but something is missing, or in the wrong...
7
by: lancewassing | last post by:
I'm hoping this question is simple. I am trying to create a login script for my already in place client manage using php. I have created a text file filled with usernames and passwords delimited by...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.