Forum Moderators: open

Message Too Old, No Replies

Inserting multiple records through Javascript

         

shanu

11:05 am on Aug 14, 2006 (gmt 0)

10+ Year Member



Hi guys,

I have a form which needs to submit to 2 sql tables, I tried using dreamweavers built in 'insert' and 'command' objects, but unfortunatly, having no luck. I need this to be in javascript.

any help would be hugely appreciated.

tnx

MisYu

2:37 pm on Aug 14, 2006 (gmt 0)

10+ Year Member



You cannot access the server's stuff directly from JavaScript, you have to use additional technologies like AJAX or RPC to achieve that. Also, even with those, passing whole SQL queries from JavaScript is unwise, hence everybody will see your database structure or so whatever- you'll surely become sql injected.

What you should do is just to pass the form to the server and catch the request there with some cgi (perl, php or whatever you're familiar with).
If you want to sql without reloading the page, then you have to use AJAX, but still you need some scripts at the server side.