Newgrounds.com — Everything, By Everyone.

Checking login status…

USERNAME:

PASSWORD:

Logging in…

Logged in as:
.
Logging out…
Inbox My Account Log Out


Forum Topic: Add To Mysql Through Flash?

(106 views • 9 replies)

This topic is 1 page long.

<< < > >>
None

jozojozojozo

Reply To Post Reply & Quote

Posted at: 3/8/08 12:45 PM

jozojozojozo EVIL LEVEL 14

Sign-Up: 09/05/05

Posts: 403

Hey, How would you add say.. '1' to a MySQL database called points?

So it contacted 'config.php' (That allowed it to connect to the MySQL database) then it added '1' point, to a certain user?
I know, this would be extremely hard, But are there any tutorials anyone could tell me?

Thanks.

LOL @ this review
Great i love it. A must if you love blowin peoples heads off.
For game http://www.newgrounds.com/portal/vi ew/283047


None

Snubby

Reply To Post Reply & Quote

Posted at: 3/8/08 12:48 PM

Snubby FAB LEVEL 20

Sign-Up: 12/04/04

Posts: 3,120

It's not that hard, I used it for this. It's kind of hard to explain, so just buy the cartoon smart tutorial on it, that's how I learned.

Buy it here


None

jozojozojozo

Reply To Post Reply & Quote

Posted at: 3/8/08 12:51 PM

jozojozojozo EVIL LEVEL 14

Sign-Up: 09/05/05

Posts: 403

At 3/8/08 12:48 PM, Snubby wrote: It's not that hard, I used it for this. It's kind of hard to explain, so just buy the cartoon smart tutorial on it, that's how I learned.

Buy it here

The thing is, I already have a login, and register working, I was wondering how you would make it so when you play the game it adds 1 point to the MySQL database, in the correct place.. D:

LOL @ this review
Great i love it. A must if you love blowin peoples heads off.
For game http://www.newgrounds.com/portal/vi ew/283047


None

UnknownFury

Reply To Post Reply & Quote

Posted at: 3/8/08 12:53 PM

UnknownFury EVIL LEVEL 19

Sign-Up: 08/10/05

Posts: 4,595

At 3/8/08 12:51 PM, jozojozojozo wrote:
At 3/8/08 12:48 PM, Snubby wrote: It's not that hard, I used it for this. It's kind of hard to explain, so just buy the cartoon smart tutorial on it, that's how I learned.

Buy it here
The thing is, I already have a login, and register working, I was wondering how you would make it so when you play the game it adds 1 point to the MySQL database, in the correct place.. D:

You have to send the data to php and then write to the mysql data in the php document as far as I know.

BBS Signature

None

jozojozojozo

Reply To Post Reply & Quote

Posted at: 3/8/08 12:54 PM

jozojozojozo EVIL LEVEL 14

Sign-Up: 09/05/05

Posts: 403

At 3/8/08 12:53 PM, UnknownFury wrote: You have to send the data to php and then write to the mysql data in the php document as far as I know.

Oh yea, It goes Flash>>PHP>>MySQL>>(If its replying, such as login)PHP>>Flash

LOL @ this review
Great i love it. A must if you love blowin peoples heads off.
For game http://www.newgrounds.com/portal/vi ew/283047


None

citricsquid

Reply To Post Reply & Quote

Posted at: 3/8/08 12:58 PM

citricsquid DARK LEVEL 23

Sign-Up: 06/25/05

Posts: 12,025

yes, you don't directly connect mySQL and flash.
Either run it through PHP or ASP.

Free directory .......|....... Paid directory
Akashic records ........|........ Resell software

BBS Signature

None

jozojozojozo

Reply To Post Reply & Quote

Posted at: 3/8/08 01:01 PM

jozojozojozo EVIL LEVEL 14

Sign-Up: 09/05/05

Posts: 403

So I would run the PHP file on flash, that would add one point (Don't know how :[) Then the PHP file would send the data to the MySQL database(Don't know how to do that :P), Then that would be that?

Help please? xD

LOL @ this review
Great i love it. A must if you love blowin peoples heads off.
For game http://www.newgrounds.com/portal/vi ew/283047


None

citricsquid

Reply To Post Reply & Quote

Posted at: 3/8/08 02:58 PM

citricsquid DARK LEVEL 23

Sign-Up: 06/25/05

Posts: 12,025

You would have a php file, say http://website.com/submit.php
Then in your flash you would do something like
http://website.com/submit.php?id=$variab lehere
So then when the button was clicked it would go to
http://website.com/submit?id=WhateverWas DefinedByTheVariable"VariableHere"
Then on the page "submit.php" you would have something like

<?php 
include ("connect.php");

$variable = $_GET['id'];
mysql_query("INSERT $variable INTO scores");
?>

Cleary that code will not work, you'd have to adapt it, but you get the idea?

Free directory .......|....... Paid directory
Akashic records ........|........ Resell software

BBS Signature

None

jozojozojozo

Reply To Post Reply & Quote

Posted at: 3/8/08 07:02 PM

jozojozojozo EVIL LEVEL 14

Sign-Up: 09/05/05

Posts: 403

At 3/8/08 02:58 PM, citricsquid wrote: You would have a php file, say http://website.com/submit.php
Then in your flash you would do something like
http://website.com/submit.php?id=$variab lehere
So then when the button was clicked it would go to
http://website.com/submit?id=WhateverWas DefinedByTheVariable"VariableHere"
Then on the page "submit.php" you would have something like

<?php
include ("connect.php");

$variable = $_GET['id'];
mysql_query("INSERT $variable INTO scores");
?>

Cleary that code will not work, you'd have to adapt it, but you get the idea?

Right, Okay thanks, do you mind explaining it? Like, the coding to work? I am a noob at PHP &MySQL.

Or can anyone explain further?

Thanks.

LOL @ this review
Great i love it. A must if you love blowin peoples heads off.
For game http://www.newgrounds.com/portal/vi ew/283047


None

citricsquid

Reply To Post Reply & Quote

Posted at: 3/8/08 07:11 PM

citricsquid DARK LEVEL 23

Sign-Up: 06/25/05

Posts: 12,025

At 3/8/08 07:02 PM, jozojozojozo wrote: Thanks.

http://tizag.com

The code i posted was just a general idea of how it would work. Click the above URL and read the tutorials, after a bit of work you'll understand it and have it working perfectly D:

Free directory .......|....... Paid directory
Akashic records ........|........ Resell software

BBS Signature

All times are Eastern Daylight Time (GMT -4) | Current Time: 08:04 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!