I have just caught the end of this topic, so hope I'm not
repeating something already mentioned.
What I do is enter my data into a plain text file, like
this;
The questions are a bit dumb, just for testing purposes of
course!
/* file: general-quizdata.sql */
/* data to populate general knowledge quiz tables */
use web_app_tester;
insert into question set
question_text = 'What is the Capital of England?';
select @questionID := last_insert_id();
insert into answer set
answer_text = 'London',
status = 'right',
questionID = @questionID;
insert into answer set
answer_text = 'Paris',
questionID = @questionID;
insert into answer set
answer_text = 'Edinburgh',
questionID = @questionID;
insert into question set
question_text = 'How many yards are there in a mile?';
select @questionID := last_insert_id();
insert into answer set
answer_text = '5000',
questionID = @questionID;
insert into answer set
answer_text = '1760',
status = 'right',
questionID = @questionID;
insert into answer set
answer_text = '2500',
questionID = @questionID;
insert into question set
question_text = 'What are the 3 primary colors?';
select @questionID := last_insert_id();
insert into answer set
answer_text = 'Red, Grey, Black',
questionID = @questionID;
insert into answer set
answer_text = 'Yellow, White, Blue',
questionID = @questionID;
insert into answer set
answer_text = 'Green, Blue, Red',
status = 'right',
questionID = @questionID;
insert into question set
question_text = 'RAM is an acronym for?';
select @questionID := last_insert_id();
insert into answer set
answer_text = 'Random Access Memory',
status = 'right',
questionID = @questionID;
insert into answer set
answer_text = 'Read Access Memory',
questionID = @questionID;
insert into answer set
answer_text = 'Read And Memorise',
questionID = @questionID;
/* data truncated here for brevity */
/* end of data */
and then load it into mysql from the mysql command
prompt with:
mysql> \. general-quizdata.sql
This may seem like the long-winded version of LOAD DATA, but
it does make the syntax easier to understand, plus you can
put any other mysql commands in the file. Also you have the
data and commands available in a file, in case you have to
reload the table from scratch again.
HTH
Keith
In theory, theory and practice are the same;
In practice they are not.
On Wed, 1 Feb 2006, Ryan Stille wrote:
> To: mysql@lists.mysql.com
> From: Ryan Stille <[EMAIL PROTECTED]>
> Subject: RE: data entry GUI
>
> You can also install MyODBC and then hook an Excel spreadsheet into your
> database. Editing the spreadsheet will update data in your database.
> This isn't a good solution if you are going to be creating new tables
> often. But for manipulating data in a known set of tables it's great.
>
> -Ryan
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]