1 Replies - 30630 Views - Last Post: 15 May 2008 - 08:11 AM

#1 pjsoumya  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 15-May 08

how to connect database in mysql to javascript?

Post icon  Posted 15 May 2008 - 03:16 AM

I have code to connect database in mysql to javascript,

[CODE]
<% @Language=Javascript %>

<HTML>

<HEAD>
<%

var conn = Server.CreateObject ("ADODB.Connection");
conn.Open (& #34;DRIVER={MySQL};SERVER=agi02;DATABASE=loginapplication;USER=root;PASSWORD=52x
mercury");

var sql = "SELECT * FROM tbluserloginform";

var rs = Server.CreateObject ("ADODB.Recordset");
rs.Open (sql,conn);

Response.Write (rs.Recordcount);
select* from tbluserloginform where nID=2

%>
</HEAD>


<BODY bgcolor=silver>


</BODY>

</HTML>




but this is not working........So please help me
Thanks in advance.........

Is This A Good Question/Topic? 0
  • +

Replies To: how to connect database in mysql to javascript?

#2 girasquid  Icon User is offline

  • Barbarbar
  • member icon

Reputation: 108
  • View blog
  • Posts: 1,825
  • Joined: 03-October 06

Re: how to connect database in mysql to javascript?

Posted 15 May 2008 - 08:11 AM

You can't actually connect Javascript directly to a mysql database.

It looks like you're trying to use a strange mixture of C# and Javascript - where did you find the original code?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1