PDA

View Full Version : Sql


Blue Raptor
06-11-2003, 17:18
I am creating and install for an engine I have designed so customers can put the site together them selves quickly but I am kind of new to the insert function, but it seems very quick and so I am trying to use it for the final install, the scrip builds all the tables fine but this is where I come undone

);

insert into article_types (title) values ('Reviews'), ('Articles'), ('News');

insert into access_masks (mask) values ('1') (page) ('login');

insert into acess_masks (mask) values ('2') (page) ('home');

insert into acess_masks (mask) values ('4') (page) ('news');

insert into acess_masks (mask) values ('8') (page) ('reviews');

insert into acess_masks (mask) values ('16') (page) ('artilces');

insert into acess_masks (mask) values ('32') (page) ('edit');

insert into acess_masks (mask) values ('64') (page) ('affiliates');

insert into acess_masks (mask) values ('128') (page) ('preview');

insert into acess_masks (mask) values ('256') (page) ('users');

insert into acess_masks (mask) values ('1') (page) ('logout');

insert into acess_masks (mask) values ('1024') (page) ('staticpages');

insert into staff_users (userid) values ('1');

insert into staff_users (username) ('admin');

insert into staff_users (password) ('21232f297a57a5a743894a0e4a801fc3);

insert into staff_users (email) ('someone@somewhere.com');

insert into staff_users (access_mask) ('2047')

);

it get a syntax error, could be any where, any body want to help me out? would be greatly appricated :)

ps that passwords is md5 and translates to "admin" becuase it is a basic account for primary use.

Poogash
06-11-2003, 18:38
This is different to how I normally do my INSERT statements. Have you tried doing it like this instead:

INSERT INTO staff_users
VALUES ('1','admin','21232f297a57a5a743894a0e4a801fc3','s omeone@somewhere.com','2047')

Uses up less space on the screen. However I did notice that there isn't a close quote on the password which might be causing it to complain.

Blue Raptor
06-11-2003, 18:43
awesome mate works a treat, wasn't sure you could use multiplie commands in the one line you see, thank you loads :D

Clarksy
07-11-2003, 00:51
SQL only works on one table at a time for DELETE, INSERT and UPDATE statements.

Strictly speaking DELETE can work on multiple tables if you set up referrential integrity - but thats a whole different subject.

Poogash
07-11-2003, 17:45
No Probs mate! :)