Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

Get value from DB using JS

Posted 18 Jun 2002 15:45:14
1
has voted
18 Jun 2002 15:45:14 Vince Baker posted:
I need to specify the following in JS to get a record from a database.

dim Menuoption
Menuoption =(rsTestGary.Fields.Item("Surname".Value)

Please help!

Vinny

Replies

Replied 18 Jun 2002 16:58:27
18 Jun 2002 16:58:27 Julio Taylor replied:
If your JS is embedded into your page, you should be able to insert a tag into it, replacing the text "Surname" with a database object. If you're using PHP, you can use something like this:

<pre id=code><font face=courier size=2 id=code>dim Menuoption
Menuoption =(rsTestGary.Fields.Item("&lt;?php echo $recordset-&gt;Fields("field"?&gt;".Value)</font id=code></pre id=code>

where $recordset is your recordset name and Fields("field" is your database field.

I haven't tested this, i'm not sure if it works, but i am quite certain you need to have the JS embedded into the page, and not as an external JS file.

i hope this helps.

--J

P.S. i killed kenny
Replied 18 Jun 2002 17:18:34
18 Jun 2002 17:18:34 Vince Baker replied:
Ta, shall give it a whirl.

vinny

Reply to this topic