# Login database

**URL:** <https://forum.kirupa.com/t/login-database/18909>\
**Category:** Uncategorized\
**Created:** [April 22, 2003, 2:49pm UTC](https://forum.kirupa.com/t/login-database/18909 "2003-04-22T14:49:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![prankster](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@prankster](https://forum.kirupa.com/u/prankster)\
**Post date:** [April 22, 2003, 2:49pm UTC](https://forum.kirupa.com/t/login-database/18909/1 "2003-04-22T14:49:00Z")

</div>

Hi. Another question. I want to create a login application in Macromedia Flash MX. What I need is for Flash MX to locate the database to check if the password is correct or not. Then, If the password is correct, I would like the user’s personal settings of the program I created on Flash to load using the data on the database. Is this possible at all? If so, can anyone help me out? Thanks a lot.

:tie:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 22, 2003, 3:47pm UTC](https://forum.kirupa.com/t/login-database/18909/2 "2003-04-22T15:47:20Z")

</div>

do you have any experience with server side programming? 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 22, 2003, 3:58pm UTC](https://forum.kirupa.com/t/login-database/18909/3 "2003-04-22T15:58:46Z")

</div>

I have none what-so-ever.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 22, 2003, 4:23pm UTC](https://forum.kirupa.com/t/login-database/18909/4 "2003-04-22T16:23:16Z")

</div>

I think it is pussible !  
I have seen a tutorial about this !  
There is many sites that have this !  
I will search and give you the link ! :run:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 22, 2003, 4:57pm UTC](https://forum.kirupa.com/t/login-database/18909/5 "2003-04-22T16:57:38Z")

</div>

It’s very possible. You’ll need to have a storage place for the data (in your case, a mySQL database would be the best), a server-side language (i use PHP) and flash.

If you have access to a mySQL database and a PHP-enabled server, let know, i can help you with this 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 22, 2003, 5:48pm UTC](https://forum.kirupa.com/t/login-database/18909/6 "2003-04-22T17:48:45Z")

</div>

I do have both a mySQL db and a PHP-enabled server… it’d be great if you could help me out.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 22, 2003, 5:59pm UTC](https://forum.kirupa.com/t/login-database/18909/7 "2003-04-22T17:59:40Z")

</div>

Another option…

If you attend to have alot of users connecting to your site,  
I highly recommend using SQL-server, if not use Access.

You can also use ASP as the Server-side language and SQLServer  
Or Access as the Database. All you have to do is call the  
code below from Flash using the loadmovie function and  
create two textboxes and variables called Username and password in Flash  
in Flash…thats about it.

ie. ASP page that calls a SQLServer Database, can easily changed  
to access a Access Db.

```
  CnString="Provider=SQLOLEDB;Data Source=MyDatabaseName;Initial Catalog=MyTableName;User Id=MyUserId;Password=MyPassword;" 

  Set Conn = Server.CreateObject("ADODB.Connection")
  Conn.Open CNString
   
  'Retrieve UserName & Password from Flash
  sUserName= Request.QueryString("Username")
  sPassWord= Request.QueryString("Password")	  
   
  sSQL="select * "
  sSQL= sSQL + "From Users Where Password='" & sPassWord "' and UserName='" & sUserName & "'"

  Set RS = Conn.Execute(sSQL)
   
  If NOT RS.EOF Then 'Valid UserId and Password
    'Do what you want
  Else 'Not a valid User
'do what you want...or display message to the user in flash ie.(assuming you have a text var)
 response.write "successfull=false" 'sent variable successfull to flash
  End If	
		 
  'Close All open Connections 
  RS.Close
  Set RS= Nothing
  Conn.Close
  Set Conn= Nothing
```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 22, 2003, 6:04pm UTC](https://forum.kirupa.com/t/login-database/18909/8 "2003-04-22T18:04:08Z")

</div>

here is a tutorial for php mySQL database login:

[http://www.daydreamgraphics.com/tutorials/list/details/2/87](http://www.daydreamgraphics.com/tutorials/list/details/2/87)

and here is something for loading PHP variables into Flash:

[http://www.flash-db.com/GuestBookTut/GuestBookDoc.php](http://www.flash-db.com/GuestBookTut/GuestBookDoc.php)
