Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Actionscript 3 And MySQL



Hi,I am trying to get Flash to insert info into a table in a MySQL DB. So far I am not having any luck. I am using PHP as the in between. Any help would be great.Thanks in advance,Here is my actionscript 3 code.stop(); submit.addEventListener(MouseEvent.CLICK, sendData) function sendData(evt:MouseEvent){ if(totwHeadline.text!="" && totwContent.text !=""){ var myData:URLRequest = new URLRequest("insert.php") myData.method = URLRequestMethod.POST var variables:URLVariables = new URLVariables() variables.Headline = totwHeadline.text variables.Content = totwContent.text myData.data = variables var loader:URLLoader = new URLLoader() loader.dataFormat = URLLoaderDataFormat.VARIABLES loader.addEventListener(Event.COMPLETE, dataOnLoad) loader.load(myData)} else status_txt.text = "All fields are mandatory"; } function dataOnLoad(evt:Event){ if(evt.target.data.writing=="Ok") { gotoAndStop(2); } else status_txt.text = "Error in saving submitted data"; }Here is my php code.<?php //Capture data from $_POST array $headlineCopy = $_POST['Headline']; $contentCopy = $_POST['Content']; //Connection to database $connect = mysql_connect("localhost", "username", "password"); mysql_select_db ("totw", $connect); //Perform the query $result = mysql_query("INSERT INTO thoughtentry(headline, content) VALUES('$headlineCopy', '$contentCopy'"); if($result) echo "writing=Ok&"; else echo "writing=Error"; $query = 'SELECT * FROM thoughtentry';if($r = mysql_query($query)) { while ($row = mysql_fetch_array ($r)) { print "{$row['headline']} <br /> {$row['content']}<br /> <br /> "; }}?>



KirupaForum > Flash > ActionScript 3.0
Posted on: 10-01-2008, 11:44 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

ActionScript 3 And Mysql
Can someone give me a link for tutorials that shows how to send information from data base to Flash file using php.

Help With Php/actionscript/mysql
hey guys -

In no way or form can I call myself a developer (well, I can! but there you go!)

I'm involved in a project which has gone from straight php/mysql - to being a flash based interface, with php/mysql backend.

Actionscript I know is the way to get the interface working - but was wondering if any of you can provide some ideas on how to do the following:::

Main Page (irrelevant)
=>
Search Page/Lookup Page
User picks location or type or price
Actionscript passes this to PHP
DB lookup
PHP passes variables back to actionscript
Displayed in sexy flash window
(I think I can do almost all of this in php - and convince management that flash isn't necessary for this bit)
+>
Then....
The fun bit is a window which will contain a video asset - link to which is supplied by a lookup table in the db, and a flash/actionscript component to pull all the other related info from the database

Do any of you know if this is possible, or more to the point - if I'm wasting my time!

Scott

Communicating Between Actionscript, Php, And Mysql
I have made a client login in flash which gets the client's username and password. After they hit submit I want to be able to run a php script that will check the username and password that was given by the client with the data that is already in the mysql database. I have already created the database in mysql. I'm looking for information on how to run the php script from flash actionscript. Any information or tutorials would be great!

ActionScript Accessing MySQL
Hi, I`m a developer but new in that ActionScript thing. I need to get data from mySql database.

There`s another way to do that without using PHP or even avoiding the MYSQL Connector Component?


Best regards,
Daniel Santana

Actionscript With Php Into A Mysql Database
http://www.sitepoint.com/article/create-flash-sketchpad

Hi I was looking to utilize a .fla similar to the sketchpad found in the above link.

Here's my situation.

I have a mysql database that goes through a series of steps. Upon reaching step 3 the user has the option to draw in the image area (thus the sketchpad function). What I wish to do is have two buttons created, which I would do so don't need explanations on that, which would clear the sketch pad and the other *save the image.

Thats what I'm looking for help on. Is there a script tutorial or any help one can give me that will allow flash to plot or save the image the user creates as a .jpg or .png (preferably) and truncate the white space and talk to some php file or the mysql database itself and save the image?

I'm in desperate need of finding this script, currently I'm using a java applet that does something similar but haven't found the correct php code to plot its exported .png file so I'm hoping that flash will allow for better communcations with php and mysql?

Please Help // Accessing MySQL Via Php & Actionscript
So I have a "blog" db setup on my server. I have the proper tables setup because you can test the entries by going here.

http://www.stopdoggynudity.com/blog.php

You will see 3 different entries with text, date, time etc ..

How I have a very very basic flash movie calling this data. It'll change when i complete the site, but at the moment I'm trying to make this work.

http://www.stopdoggynudity.com/test.swf

With the following code, it's suppost to call and get the data from the most recent blog entry, and post it in the appropriate text box, along with date and time.

Next it also calls previous entries, and posts it in the 'entries_txt' box.

I know it's on the flash side of things because when accessing the .php file I can clearly see the entries, time and date. Well when exporting it out of flash, the only thing that shows is the most recent entry. No time, date, or previous posts. This happens 'online', and on my local machine. I get a "undefined" post because it can't find the blog.php file—which is expected.

ActionScript Code:
//function to load external data using the loadVars() object
//l=name of loadVars object
//n=name of text field
//t=trigger to decide whether to show all entries or just one.
//e= entry number to display (number)
//f=file to load from (string)
function lv(l, n, t, e, f) {
sb.setSize(null, 200);
sb2.setSize(null, 50);
//create a new loadVars object if one doesn't already exist if it does, use it
if (l == undefined) {
l = new LoadVars();
l.onLoad = function() {
var i;
//clear out any text that might already be there
n.htmlText = "";
//to show a single entry at a time we use the following code
if (t == undefined) {
n.htmlText += "<b>"+this["title"+e]+" - "+this["date"+e]+"</b><br><br>";
n.htmlText += this["entry"+e];
} else {
//cycle through and show all entries
for (i=0; i<this.n; i++) {
n.txt.htmlText += "<u><a href='asfunction:_root.loadArc,"+this["id"+i]+"'>"+this["title"+i]+" - "+this["date"+i]+"</a></u><br>";
}
}
sb.update();
sb2.update();
};
}
l.load(f);
}

function loadArc(passed) {
arcNum = passed-1;
lv(blog_lv, entries_txt, undefined, arcNum, "blog.php");
}

//for the large entry textfield
lv(blog_lv, entries_txt, undefined, 0, "blog.php");
//for the archives text field
lv(archive_lv, archive_txt, "cycle", null, "blog.php");

//sb = sidebar for the entries_txt box
//sb2 = sidebar for the archive_txt box
//thanks all -michael


This code is not my own, as I am/was following a tutorial. Any help would be greatly appreciated. I don't want to setup a blog for my client through a 3rd party because I want to keep the whole site flash-based, and don't want users to travel out of the site.

I could also set this up just by calling dynamic text etc .. but I'm having fun learning to use MySQL and php.

Flash 5 Actionscript, PHP, MySQL Help
Greetings all,
This is my first post here at Kirupa so I hope I get it right...

At the end of a game I'm making I want to display the length of time it took to complete. When all is said and done (i.e., after all the code and calculations have been done to get the hours, minutes, and seconds played) I have code that looks kind of like this:

gameTime = gameHours + ":" + gameMinutes + ":" + gameSeconds;
So that gameTime looks like: 08:24:32

I'm trying to put gameTime, along with a few other items of data, into a database via PHP and MySQL. I've been successful at passing regular old integers and text into my database table using loadVariablesNum but haven't been able to pass "gameTime". My hunch is that it has something to do with the colons in the gameTime string but I'm not sure.
When I say that I "haven't been able to pass" what I mean is when I click on the button that's supposed to put the data into the database nothing happens, whereas when I click on the button when I'm just trying to pass simple numbers and text I'll see "transferring data from..." in the bottom left corner of my FireFox browser and when I look at the database, values have been entered. I think the problem is the data type of gameTime because if I change gameTime to something like a number or text it puts it in the database just fine. It's only when I make gameTime look how it actually needs to be that I have a problem.

Hopefully my problem is clear and hopefully I'm in the right place. If you need more info just let me know.
Thanks!

MMORPG - ActionScript, PHP, MySQL
Alright, me and some friends have thought of making a MMORPG game, but not sure where to start. Since I know PHP/MySQL pretty darn well and still getting the gist (but better than a newbie) of actionscript. I've thought about other languages such a C++ and Visual Basic, but they seem like too much work to do for a simple task that can be done in PHP. So, I wanted to ask how would I go about this. I've done a normal PHP/MySQL browser game about 5 months ago so I know that's going to be the easy part (sort of). Now the problems I'm running into is this: PHP is called once and Flash is, how do I put this... like Javascript and can be called whenever (not needing the page to refreshed). So by having a server-side script mixed with a client-side script would be...different for me. Would this cause lag?. Then I was thinking how do I know where the user is? I thought about it and I found that by using coordinates, like (10,10). So then having to send that to PHP then to mySQL to log it (for if the user closes out of the game without clicking quit) wouldn't that cause lagging also. The other reason I'm sending it to PHP is so I know where to place them if another user comes close to them. I mean no one clicks a coordinate one at a time, they click about 5 or so where they want to go. Alright, if you got those anwsered, well good. Now what about the movement of the game. I want it so that the mouse is where the user's person would go to when clicked. I have no idea how to do this either. I don;t know what else to say on this subject. Next, how do I put other people on the screen?. As I send above I would use coordinates to do this, but I don't know how to show them in flash like if the user can only see 25 x 25 boxes (coordinates) and say User A is on coordinate (5,5) and User B is on coordinate (5,6), how would I make it so that User B is above User A. Then when User A walks I want to keep User B there.
I think those are most of my question right now, if I think of anymore I'll post them asap. If you need anymore information please post here or IM me on AIM at XiaBoy007.

Thank you very much,
Jesse Smith

Sending Text From Actionscript To MySQL
Hello everyone, hope u r all well.

Got a bit of a simple question. I have a textArea box (mesgArea.text) where a user can write a simple message and then press a send button ("sendMsg").

All i really need is when that user presses the sendMsg button, for the message to be stored in the field called "messagedescription" in the "messages" table in mySQL database.

Thus when i look in the actual database the message typed by the user in flash will be stored in the "messagedescription" field in mySQL.

I have been told that the loadVars method may be useful.

I am utterly stuck. Does anyone know the actionscript/PHP for this?


Thank you for all your help.

Problem With Dates Between Actionscript And Php/mysql
I want to register a form in mysql with the current date.
Later, I want to be able to search the mySQL database to find if there is a record with this date.
I am completely confused with the different formats and timestamps.
Is there a simple solution ?
Thank you for your help.

Sending A Message From Actionscript To MySQL
Hello everyone, hope u r all well.

Got a bit of a simple question. I have a textArea box (mesgArea.text) where a user can write a simple message and then press a send button ("sendMsg").

All i really need is when that user presses the sendMsg button, for the message to be stored in the field called "messagedescription" in the "messages" table in mySQL database.

Thus when i look in the actual database the message typed by the user in flash will be stored in the "messagedescription" field in mySQL.

I have been told that the loadVars method may be useful.

I am utterly stuck. Does anyone know the actionscript/PHP for this?


Thank you for all your help.

Connecting To A Mysql Database With Actionscript 3?
I am wanting to make a login and sign in form in flash cs3. I am using a mysql database. I know how to make a login form in javascript, but I am stuck with actionscript. How do you make one with as3? With the site I'm making it's quite important for me to know how to do it.

Sorry if this is a noob question, I'm still new to flash.

Actionscript 3 Info. To MySQL Database?
I'm somewhat stuck as to how to do this.

I've loaded my MySQL records into flash with a PHP created XML file. I then change the data using AS3 and it is saved into arrays. The data consists of 12 strings each with a length of 30 or so, like this:

month[3] = "11122200121011110010102221100";

I've used the ExternalInterface() function in the past, but how can I write these arrays to my database? AS3 to javascript? Through a post form and update records?

Thanks ahead of time.

Help Actionscript Updating Mysql Table
Whenever i start my flash game ... it updates my mysql table at cash and sets it to 0 and in no place do i have a update statement...
the only thing i have is at the very end it loadvar command thing
and then the script selects cash but it selects 0 everytime because whenu start the game ... it sets cash to 0

help

Actionscript To Pull Images From Php/mysql
here's a great tutorial I found
(at least it seems great)
http://www.spoono.com/php/tutorials/tutorial.php?id=42

1. readdir.php - this puts all the images in a folder into the database
2. image.php - the actual image script that displays the imag
3. view.php - an example file that shows you how to call the image

now...we need...
STEP 4....
how do we pull these images into FLASH

can't find this information anywhere

Help Actionscript Updating Mysql Table
Whenever i start my flash game ... it updates my mysql table at cash and sets it to 0 and in no place do i have a update statement...
the only thing i have is at the very end it loadvar command thing
and then the script selects cash but it selects 0 everytime because whenu start the game ... it sets cash to 0

help

Actionscript To Pull Images From Php/mysql
here's a great tutorial I found
(at least it seems great)
http://www.spoono.com/php/tutorials/tutorial.php?id=42

1. readdir.php - this puts all the images in a folder into the database
2. image.php - the actual image script that displays the imag
3. view.php - an example file that shows you how to call the image

now...we need...
STEP 4....
how do we pull these images into FLASH

can't find this information anywhere

Apache, MYSQL, PHP And Actionscript To Load Images
Please don't stear away due to the abundant content, I just wanted to give as much detail as I could.
This problem may not be due to actionscript but settings in apache... maybe. As you guys have alot of experience though I have no doubt you have come across a similar problem before. I have not found anything of help in the forums so here's my post. Probably a simple fix I hope.

I have been working on creating a flash file with actionscript 2.0 to display images as a slideshow.
The images it is displaying are located on my webserver and their location is what I am saving in my MYSQL database fields.

I am using LoadVars in actionscript to pull a string of comma seperated locations from my php file that queries the MYSQL database. I then split this string to form an array in actionscript that holds all my image locations. I then use these locations to load the jpgs into my containers in flash.

The above works perfectly when I run the flash file within flash but as soon as I embed it in html I get a quick flicker of blue and then nothing. (the page says Done and the flash object is embedded but blank).

What I have tried:
Flash works perfectly in my browsers and I have tried this in firefox and IE on 3 different computers.

I have tried embedding other flash projects into html and trying them on this server and they work fine. (The only difference with these projects are that they do not use LoadVars().

------------------------------------------------------------------------------------------
More details that could help in diagnosing/explainations:
------------------------------------------------------------------------------------------
My webserver is local on this machine (I am running LAMP on Ubuntu 8.10 with XP on a virtualBox to write in actionscript.
I have also uploaded my files to my remote webserver though and I get the same problem. This location is www.bnoyzy.com/NSindex.html
Incase it helps here is some of my code:

Actionscript

within first frame in my actions layer

Code:
stop();

// -------- GLOBALS ---------

var transitionLock:Boolean = true;
var imageIndex:Number = -1;
var imageArray:Array;
var containerArray:Array;
var imagesLoaded:Boolean = false;
var milestone = 0;

// --------LISTENERS---------

//Add listener for MovieClipLoader to level0/_root
var loader_mcl = new MovieClipLoader();
//Add the current timeline as a listener of loader_mcl
loader_mcl.addListener(_level0);

//END OF -------LISTENERS---------

//Load images from MYSQL via php
var load_lv = new LoadVars();

//fetch from test php
load_lv.load("http://10.1.1.2/test.php");

load_lv.onLoad = loadTextVariables;

function loadTextVariables(success)
{
if(success)
{
trace("Names output from php file" + this.names);
//split the string into an array
var nameArray:Array = this.names.split(",");
//assign the global array to this new names array so it is acessable globally
_root.imageArray = nameArray;

//Create image containers to assign images to
createImageContainers();

//Change the image displayed
transitionImage();
}
}

function createImageContainers()
{

for(containerIndex = 1; containerIndex < _root.imageArray.length; containerIndex++)
{
_root.imageContainer0.duplicateMovieClip("imageContainer" + containerIndex, _root.getNextHighestDepth());
trace(_root["imageContainer" + containerIndex]._x);
_root.containerArray.push(_root["imageContainer" + containerIndex]);
//_root.containerArray[containerIndex]._x = containerIndex * 100;
//_root["imageContainer" + containerIndex]._x = containerIndex * 100;
_root["imageContainer" + containerIndex]._visible = false;
trace(_root.containerArray[containerIndex]._x);

}

}

function transitionImage()
{
transitionImageIndex();
if(_root.imagesLoaded)
{
setTimeout(transitionImage,2000);
}
else
{
startPreloader(_root.imageArray[_root.imageIndex]);
}
_root.transitionLock = true;


}

function transitionImageIndex()
{
_root["imageContainer" + _root.imageIndex]._visible = false;

if(_root.imageIndex < (_root.imageArray.length - 1))
{
_root.imageIndex = _root.imageIndex + 1;

}
else
{
_root.imagesLoaded = true;
_root.imageIndex = 0;
}
_root["imageContainer" + _root.imageIndex]._visible = true;
trace("imageIndex = " + _root.imageIndex);
}

function startPreloader(url)
{
trace("URL within startPreloader is: " + url);
trace("imagecontainer0 is: " +imageContainer0);
trace("imagecontainer is: " + _root["imageContainer" + containerIndex]);
loader_mcl.loadClip("members/noyzy/images/" + url,_root["imageContainer" + _root.imageIndex]);
}

function onLoadStart(target)
{
_root.flower.gotoAndPlay(1);
_root.flower._visible = true;
_root.dynamText._visible = true;
}

function onLoadProgress(target, bytes_loaded, bytes_total)
{
trace("LoadProgress = "+bytes_loaded+ " of "+bytes_total);


var percent = Math.floor((bytes_loaded / bytes_total) * 100);
var flowerFrame = (Math.floor(percent/4)*4)+1
//var petalFrame = percent - flowerFrame;
var petalNum = Math.floor(percent/4);

if((flowerFrame - _root.milestone) == 0)
{

}
else
{
_root.flower.gotoAndStop(flowerFrame);
//_root.flower["petal"+petalNum].gotoAndPlay(1);
_root.milestone = flowerFrame;
}
_root.dynamText.text = (Math.floor((bytes_loaded / bytes_total) * 100)) + "%";
}

function onLoadComplete(target)
{
trace("completed image"+_root.imageIndex)
setTimeout(transitionImage,2000);
_root.flower._visible = false;
_root.dynamText._visible = false;
//_root.transitionLock = false;
}

function onLoadInit(target)
{
trace("INIT HAS BEEN CALLED");
}
function onLoadError(target, error_code)
{
trace(error_code);
}

test.php

Code:
<?php

$query = "SELECT Images.FileName FROM Members, Images WHERE Members.MemberID = Images.MemberID AND Members.username = 'noyzy'";

mysql_pconnect("localhost","application","password")
or die("Unable to connect to SQL server");
mysql_select_db("yie") or die("Unable to select database");
$result = mysql_query($query) or die("Insert Failed!");
$arrayIndex = 0;
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$imagesArray[$arrayIndex] = $row["FileName"];
$arrayIndex ++;
}

$x = implode(",",$imagesArray);

print "names=$x";


?>
html file

Code:
<html>



<body>


<object width="650" height="520">
<param name="movie" value="PortfolioFLASH.swf">
<embed src="PortfolioFLASH.swf" width="550" height="400">
</embed>
</object>

</body>

</html>

Actionscript Code Not Working - Connecting To MySQL
Hi,
I did a tutorial on how to connect a Flash Dynamic text box to a MySQL database. I created a PHP file which connects to the database and displays fine. The tricky part has been getting Flash to display the results in the PHP file. Here is my AS code. If anyone can see what I am doing wrong can you help please. Much appreciated.


Code:
//function to load external data using the loadVars() object
//l=name of loadVars object
//n=name of text field
//t=trigger to decide whether to show all entries or just one.
//e= entry number to display (number)
//f=file to load from (string)
function lv(l, n, t, e, f) {
sb.setSize(null, 200);
sb2.setSize(null, 50);
//create a new loadVars object if one doesn't already exist if it does, use it
if (l == undefined) {
l = new LoadVars();
l.onLoad = function() {
var i;
//clear out any text that might already be there
n.htmlText = "";
//to show a single entry at a time we use the following code
if (t == undefined) {
n.htmlText += "<b>"+this["date"+e]+" - "+this["location"+e]+"</b><br><br>";
n.htmlText += this["comment"+e];
} else {
//cycle through and show all entries
for (i=0; i<this.n; i++) {
n.txt.htmlText += "<u><a href='asfunction:_root.loadArc,"+this["id"+i]+"'>"+this["date"+i]+" - "+this["location"+i]+"</a></u><br>";
}
}
sb.update();
sb2.update();
};
}
l.load(f);

function loadArc(passed) {
arcNum = passed-1;
lv(entries_lv, entries_txt, undefined, arcNum, "../php/shows-query.php");
//for the large entry textfield
lv(entries_lv, entries_txt, undefined, 0, "../php/shows-query.php");
//for the archives text field
lv(archive_lv, archive_txt, "cycle", null, "../php/shows-query.php");


}

}

Thank you
Kay

Actionscript Code Not Working - Connecting To MySQL
Hi,
I did a tutorial on how to connect a Flash Dynamic text box to a MySQL database. I created a PHP file which connects to the database and displays fine. The tricky part has been getting Flash to display the results in the PHP file. Here is my AS code. If anyone can see what I am doing wrong can you help please. Much appreciated.


Code:
//function to load external data using the loadVars() object
//l=name of loadVars object
//n=name of text field
//t=trigger to decide whether to show all entries or just one.
//e= entry number to display (number)
//f=file to load from (string)
function lv(l, n, t, e, f) {
sb.setSize(null, 200);
sb2.setSize(null, 50);
//create a new loadVars object if one doesn't already exist if it does, use it
if (l == undefined) {
l = new LoadVars();
l.onLoad = function() {
var i;
//clear out any text that might already be there
n.htmlText = "";
//to show a single entry at a time we use the following code
if (t == undefined) {
n.htmlText += "<b>"+this["date"+e]+" - "+this["location"+e]+"</b><br><br>";
n.htmlText += this["comment"+e];
} else {
//cycle through and show all entries
for (i=0; i<this.n; i++) {
n.txt.htmlText += "<u><a href='asfunction:_root.loadArc,"+this["id"+i]+"'>"+this["date"+i]+" - "+this["location"+i]+"</a></u><br>";
}
}
sb.update();
sb2.update();
};
}
l.load(f);

function loadArc(passed) {
arcNum = passed-1;
lv(entries_lv, entries_txt, undefined, arcNum, "../php/shows-query.php");
//for the large entry textfield
lv(entries_lv, entries_txt, undefined, 0, "../php/shows-query.php");
//for the archives text field
lv(archive_lv, archive_txt, "cycle", null, "../php/shows-query.php");


}

}

Thank you
Kay

Flash MX Actionscript PHP And MySQL - Freezes Peoples Computers Help.
Hi,

I have finished a piece of online artwork for an artist that uses mysql, php and flash actionscript all working together.

You can view it here to get an idea.

It has been a struggle getting it all to work as I am relatively new to bring those technologies together, but now it is functioning we have a problem. The whole piece generally eats up processor power on people’s computers and eventually causes people on slower machines’ computers to freeze.

I can’ t figure out why, as there are exit point fro all the loops in the actionscript and the PHP and database are relatively simple and small.

A test version of just the matchstick interaction indicated that this aspect doesn’t seem to be the problem and that only when everything was together did this degradation of usability occur.

Basically my question is: Does anyone have an idea why this problem occurs? Is it just the time taken to fetch, write and update information from and to mysql from flash and php does this or is my programming eschew [which is entirely possible : )] .

You can download the zipped .fla file here to have a look, I hope it is not too confusing.

Any advice, solutions, directions to look in, criticisms etc all welcome!

Many thanks,

G*

Export Querries From Flash 8 To MySQL And Import Data From MySQL
Hi friends,
I am making a web site for a customer and i need to import data from MySQL Database but i don't know how to do it.
I would appreciate it if somebody could give me an idea or tell me where to find a tutorial.
Also i heard that there is a .dll file that Macromedia made, in order to make it easier to connect Flash with Databases, is that true ?

[FL8 + PHP + MySQL] Adding/Deleting/Viewing Content From MySQL Db
So... Viewing isn't actually the issue here, I just added it to make it a full triangle . I'm doing that with a PHP that writes the contents of the dB in XML syntax.

But, to make it clear, I am trying to develop an application that communicates with a MySQL database, via PHP. And you have the option to add/delete fields, but also in the Flash application.

I found some source at the gotoAndLearn forums, but it simply would not work! I am uploading a zip of the files. The main problem with this is that when I am adding something, the dB gets filled with blanks. This boggles my mind. Not being a big PHP knower (not knowing anything, really), my suggestion is that the variables don't get sent properly. But then again...

Some help with this please? I'm in a kind of a tight spot here, so some help would be really in handy!

Cheers

Php,mysql And Flash- How To Display Picture In Flash From Mysql
How are you all?
I have a question for php,mysql and flash gurus.
Before I ask this question I will describe what I want briefly.
Using php, I retrieve a path to a picture from mysql and send it to flash movie as a variable.
Now what I would like to do is using this path to a picture how to display the picture as a part of a movie?

Cheers,

MySQL
Where can I see some tutorials on how getting SQL or/and ASP working in a Flash "movie"?

Php Mysql
I'm looking for a free host which accepts php and sql.
I'm trying to upload my own message board, and I'd rather the host be free. Any ideas anyone
Many thanks for any ideas......

MySQL
ok, im lookin 4 sum1 who uses (or has used before, or just knows about MySQL databases) brinkster for making a MySQL database... all i want to know is how to have people play my game but be able to save their username, password, and maybe 1 or two variables... please help me, anybody (note: i am almost a complete newb to MySQL... i know most of the functions, but i dont know what their purposes are)

A 'MySQL'
MySQL seems to perform an ignore case on a 'where' clause. Has anybody come across such a situation? If so how do I fix my query?

Here is an example of my problem:

If the LAST_NAME = 'SMITH' (notice last name is in upper case). LAST_NAME is a column from a MySQL table.
and I perform the query as:

select last_name where last_name = 'smith'

I still get a hit. MySQL returns the row.

That's incorrect; the comparison is ignoring the case of the pattern 'SMITH'.

Any suggestions will be appreaciated.

Thanks
Raymond

Php And Mysql :-)
Hi,

I'm wondering if it would be possible to insert php code into a flash movie.

Like when you build a button that will close window by inserting a javascript code ("javascript:window.close()")...

So I'd like to know if there's a way to insert php instead of javascript...

I'm trying to build a little application database based, but I'm not able to build what I really would...

I've build 3 scroll lists, the fisrt one pulls data from a php script on a mysql database, and according to user's choice, it will update the second scroll list, then user will be asked to select something again, but this time in the 2nd scroll list, and again, according to user's choice, 3rd scroll list will be updated too.
Finally, when user choose a name from 3rd scroll list, it will load an external movieclip into stage, witch path is stored in database...

As I've tried to do so and wasn't able to, I'd like to know if there's a possibility to insert php code in movies, doing so it will (if possible) directly connect to dabase without external php files...

Thanks for replying.

War_Angel

MySQL
hello,
using Jeff's tutorial, I installed Apache, PHP and MySQL. But being a newbie, I am asking for help: could anybody give me links where I can easily learn how to use (win)MySQL(Admin)1.4 ???

Thanks a lot

Xml + Mx Vs. Php+mysql+mx
hello all.
I've been working with flash+ php+mysql for over 2 years, can get data from database, manipulate it any number of ways, bring it into flash to suit the needs of a particular project and so on.

I'd like to now get into doing the same sort of thing using xml+flash, but I think I'm missing some basics. Here are some basic questions to get me over this hump and I'll be on my way.

can xml be dynamically generated?
if so... using php to extract data, then form xml nodes to be imptoted into flash... isn't that just an extra step in the process?
if not... what advantages are there to using xml vs. php?

could someone give me an example of the power of using xml+flash that will make me think..." Damn, I really need to learn this... NOW. "

Thank you in advance for your time.

MySQL
hey, i am thinking of useing mySQL/php for a game but i know nothing of mySQL or php but it seems i need a program so i can use them, any files that are in php i can't even look at or read, what program do i need to be able to read them?

Mysql Php Help
Hi Everybody,
if anyone could help me, that would be great.
i setup a mysql server, and i have php that
i want to be working off that mysql. Is there
a config file where i specify that php is using
mysql...

thanks again,
Robert,,.

MySQL Help
I already have a database setup with the users for my website. There are many records in it. I am working on a full flash website. I already know how to display records in PHP but dont know how in flash mx. The one thing that i want to do is only display the most resent entry. Can someone help!

MYSQL/PHP Into AS3
How can I receive data from MYSQL/PHP into AS3.


PHP Code:




<?php

$host = "locahost";
$user = "<username>";
$pass = "<password>";
$db = "<database_name>";

$link = @mysql_connect($host, $username, $pass) or die(mysql_error());
mysql_select_db($db);

$query = "SELECT * FROM site";
$result = mysql_query($query);

while($row = mysql_fetch_object($result))
{
  echo $row->title;
}

?>







I need help creating the script to receive data.

Thanks

Php+mysql
hi everybody, i created a movieclip named "rectangle" and i must duplicate it and assign its clones x,y and aplha values from mysql
my communication page outputs this:


Code:
totale=4&x1=324&y1=345&alpha1=65&x2=656&y2=34&alpha2=32&x3=231&y3=12&alpha3=87&x4=976&y4=567&alpha4=51
in the first frame of the timeline i wrote this:


Code:
myvars = new LoadVars();
myvars.load("mypage.php");
myvars.onLoad = function(success) {
for (this.a=1; this.a<=this.totale; this.a++) {
_root."rectangle".duplicateMovieClip("rectangle"+this.a,1);
setProperty("rectangle"+this.a, _x, this["x"+this.a]);
setProperty("rectangle"+this.a, _y, this["y"+this.a]);
setProperty("rectangle"+this.a, _alpha, this["alpha"+this.a]);
}
};
..but it clones the movieclip only once (without setting its properties)..
what did i mess up?

Help With MySQL
To get to understand MySQL, I'm triyng to follow this tutorial:

http://www.actionscript.org/tutorial...QL/index.shtml

However, it gets stuck in the process - the votes are recorded in the database but the flash program cannot successfully go through the rest of the program, showing the results.

My setup is here:
http://www.emvee.net/calendar/Untitled-3.html

Anyone know what might be wrong?

Following is the coding:

Frame 1:

Code:
stop();
submit_btn.enabled = false;
var loadVars_in:LoadVars = new LoadVars();
var loadVars_out:LoadVars = new LoadVars();
loadVars_in.onLoad = function(success) {
if (success) {
//If the values are in goto results
gotoAndStop("result");
} else {
//notify of failure
}
};
// Does the user wants to vote?
listenerObject = new Object();
listenerObject.click = function(eventObject) {
submit_btn.enabled = true;
};
radioGroup.addEventListener("click", listenerObject);
//Vote
submit_btn.onRelease = function() {
var selectedNum:Number = radioGroup.selectedData;
loadVars_out.choice = selectedNum;
label.text = loadVars_out.choice
loadVars_out.sendAndLoad("vote.php", loadVars_in, "POST");
};
Frame 10 (it never reaches this frame)

Code:
//How many votes in total?
var totalVotes:Number = loadVars_in.totalVotes;
var end:String
for(i=1;i<=4;i++){
vote = loadVars_in["vote" + i + "total"]
percent = Math.round(( vote / totalVotes) * 100);
if(vote==1){
end = " Vote";
} else {
end = " Votes";
}
_root["graph"+i+"_mc"].bar_mc._xscale = percent;
_root["graph"+i+"_mc"].percent.text = percent + " % - " + vote + end;

}
vote.php

Code:
<?
//User, password & database
$choice =$_POST['choice'];
$user="my username blanked out";
$password="my password blanked out";
$database="my database name blanked out";
mysql_connect("localhost",$user,$password);
@mysql_select_db($database) or die( "Unable to connect to database");
// what choice did the user choose in flash?
if($choice == 1){
$query="UPDATE votesystem SET vote1=vote1+1";
}
if($choice == 2){
$query="UPDATE votesystem SET vote2=vote2+1";
}
if($choice == 3){
$query="UPDATE votesystem SET vote3=vote3+1";
}
if($choice == 4){
$query="UPDATE votesystem SET vote4=vote4+1";
}
mysql_query($query);
//Get values from the database
$query="SELECT * FROM votesystem";
$result=mysql_query($query);
mysql_close();
//What are the values from the database?
$vote1_out=mysql_result($result,0,"vote1");
$vote2_out=mysql_result($result,0,"vote2");
$vote3_out=mysql_result($result,0,"vote3");
$vote4_out=mysql_result($result,0,"vote4");
//Votes in total
$total=$vote1_out+$vote2_out+$vote3_out+$vote4_out;
//Info to send back to flash:
$values="&totalVotes=$total&vote1total=$vote1_out&vote2total=$vote2_out&vote3total=$vote3_out&vote4total=$vote4_out";
echo "$values ";
?>
Thanks!

MySQL Vs. XML
I am planing to add a bus schedule to my site.
The way it would work is that a user selects a city, a schedule of departures, route, info (ex. weekday's only...) and bus company shows up.

All current text on my site is in xml files, so that I can update easily.

But for this section (communication) I am thinking of putting this info into MySQL into 4 tables (destination, route, info, bus_company)

Anyway is there an adventage of using a database for something like this, cause it seems to me that sticking to XML files would be better (easier to move files & make changes)

AS3 PHP MySQL
hi guys quick question,

building my first site in AS3, previous sites i've built have used a mySQL DB and php to deliver site content to flash and this was done with the 'LoadVars' class in AS2.

Has anyone done this in AS3 yet? i know they got rid of the 'LoadVars' class in AS3, and they now have the 'loader' class but has anyone read in variables from a php file without it being formated in XML?

eg. php page displays "&myVar1=this&myVar2=that"

is there a new way to do this?

Using AS3 And PHP/MySQL Together ? HOW ?
Ok here is my pain , and i believe not just mine but one that could once fixed help many people ... i am trying for example to create a website which needs quite a big database ... so i need MySQL .But the problem is that AS3 cannot directly operate MySQL databases as PHP. What i want to do is after collecting the data in flash and having the data i need in variables in AS3 i need then to pass them to a PHP which can then operate with the database and pass data back to the AS so i can perform checks if someone has already created acc with that name or if two product serial numbers match or whatever.
What i mainly need is a way to pass variables from AS3 to PHP and back from the PHP to the AS.
Can someone please tell me how does this happen if it is possible or post a link for a tutorial or maybe a Skype MSN ICQ or MIRC channel where i can connect him to explain me or send data or a tutorial.
I will be really grateful if someone helps me with this issue and i will return the favour with as much as i can.

MySQL Without PHP?
Alright, I'm fairly certain this shouldn't be too hard to figure out, but I'm a bit tired (4 am) so the words in the help files are kindof lost on me atm... Might be able to work it out tomorrow.

But yea, onto my point. I'm fairly sure that there should be some way to grab data off a SQL server without using external scripting in this new version, what with all the different data handling things they've added, so does anybody have any good tips / tutorials / help about doing this?

I have no problem with writing the scripts in PHP if I have to, just want to get this thing as clean as humanly possible.. Thus as few files as I can manage. Also keeping it all in one file feels a bit more organized to me.

I have never in my years had to ask for help for Flash before so I'm sorry if I needed to say something more specific.. But I think it's understandable.

Thanks,
Jonas.

Some PhP MySQL Help...please
Okay i did the tutorial on PhP and MySQL but my problem is they use

if(_root.checklog == 1){
_root.gotoAndPlay(60);

but since i'm using extrenal swf's the "_root" comand doesn't refer to the external swf. But i'm using "_root" to call the new external files so i can't ancor the "_root" I've tried to change it to

if(_parent.checklog == 1){
_parent.gotoAndPlay(60);

but now nothing happens. I'm about sixty seconds from going postal on my computer trying to figure this one out. but i know when i do i'll be a lot happier. If you want to check out my work to see what i'm talking about go to,
www.versusmediagroup.com

under the client login page and you'll see what it looks like and how it doesn't do a thing. To get the fla files go to http://www.versusmediagroup.com/kirupa/

its the client.fla file.

Any help would be really great.
Thanks

MySQL Or XML
I'm looking for recommendations on whether it's easier/better to get Flash to interact with a MySQL database or XML. Basically, I'm trying to develop some simple (and minimally animated) slides involving a list of words and their frequencies (number of occurrances). Ultimately, the Flash script needs to be able to call each word in the list, then size the word and a bubble relative to the number of occurances. Simple, right? Problem is that I'm not zippy with feeding the data into a script. I can handle simple flash animations and such, but I'd be grateful for any recommendations about how best to proceed.

Thanks!

MySQL Without PHP?
hi,

can i get data from a mySQL database without using a PHP-file?

thanks!

[AS][PHP][MYSQL]Something Big, Can You Help Me?
Hello,

I have a big problem and i don't know what is wrong! This problem sounds like this:
---------------------------------A little description of the site.
I have a main movie where i have 4 movieClips (with the instance name: home_mc, club_mc, gute_mc and stuff_mc), initial they are invisible (ex: home_mc._visible = false and when i click a button the movieClip assign to that button will become visible.
I have in every movieClip some text areas(input and dynamically), datagrids and button and in action layer i have #include "*.as" (* = the name of the movieClip; home has home.as, club has club.as etc)
Here are the actionscript files:
Main.as

ActionScript Code:
//Site initial property.home_mc._visible = false;club_mc._visible = false;gute_mc._visible = false;stuff_mc._visible = false;kontakt_mc._visible = false;news_mc._visible = false;adver_mc._visible = false;//Initial Animation Components////Tween First View.import mx.transitions.Tween;import mx.transitions.easing.*;var tw:Tween = new Tween (main_headline, "_xscale", Elastic.easeOut, 0, 100, 3, true);var tw1:Tween = new Tween (main_headline, "_yscale", Elastic.easeOut, 0, 100, 3, true);//Button Textsbtn_home.button_text_mc.button_text.text = "Home";btn_club.button_text_mc.button_text.text = "Club";btn_gute.button_text_mc.button_text.text = "gute Scheiben";btn_stuff.button_text_mc.button_text.text = "DJ Stuff";btn_kontakt.button_text_mc.button_text.text = "Kontakt";btn_news.button_text_mc.button_text.text = "News/Specials";btn_adver.button_text_mc.button_text.text = "Advertising";//Button Actionscriptbtn_home.onRelease = function () {    //Tween Home Mc    var tween_home = new Tween (home_mc, "_xscale", Elastic.easeOut, 0, 100, 1, true);    var tween_home1 = new Tween (home_mc, "_yscale", Elastic.easeOut, 0, 100, 1, true);    var tween_home2 = new Tween (home_mc, "_alpha", Elastic, easeInOut, 0, 100, 1, true);    //*    //    home_mc._visible = true;    loadMovie(home_mc);    //    club_mc._visible = false;    club_mc.unloadMovie();    gute_mc._visible = false;    gute_mc.unloadMovie()    stuff_mc._visible = false;    stuff_mc.unloadMovie()    kontakt_mc._visible = false;    kontakt_mc.unloadMovie()    news_mc._visible = false;    news_mc.unloadMovie()    adver_mc._visible = false;    adver_mc.unloadMovie()};btn_club.onRelease = function () {    //Tween Club Mc    var tween_club = new Tween (club_mc, "_xscale", Elastic.easeOut, 0, 100, 1, true);    var tween_club1 = new Tween (club_mc, "_yscale", Elastic.easeOut, 0, 100, 1, true);    var tween_club2 = new Tween (club_mc, "_alpha", Elastic, easeInOut, 0, 100, 1, true);    //*    home_mc._visible = false;    home_mc.unloadMovie();    //    club_mc._visible = true;    loadMovie(club_mc);    //    home_mc._visible = false;    home_mc.unloadMovie();    stuff_mc._visible = false;    stuff_mc.unloadMovie()    kontakt_mc._visible = false;    kontakt_mc.unloadMovie()    news_mc._visible = false;    news_mc.unloadMovie()    adver_mc._visible = false;    adver_mc.unloadMovie()};btn_stuff.onRelease = function () {    //Tween Stuff Mc    var tween_stuff = new Tween (stuff_mc, "_xscale", Elastic.easeOut, 0, 100, 1, true);    var tween_stuff = new Tween (stuff_mc, "_yscale", Elastic.easeOut, 0, 100, 1, true);    var tween_stuff = new Tween (stuff_mc, "_alpha", Elastic, easeInOut, 0, 100, 1, true);    //*    home_mc._visible = false;    home_mc.unloadMovie();    club_mc._visible = false;    club_mc.unloadMovie()    home_mc._visible = false;    home_mc.unloadMovie();    //    stuff_mc._visible = true;    //    kontakt_mc._visible = false;    kontakt_mc.unloadMovie()    news_mc._visible = false;    news_mc.unloadMovie()    adver_mc._visible = false;    adver_mc.unloadMovie()};btn_gute.onRelease = function () {    //Tween Stuff Mc    var tween_gute = new Tween (gute_mc, "_xscale", Elastic.easeOut, 0, 100, 1, true);    var tween_gute = new Tween (gute_mc, "_yscale", Elastic.easeOut, 0, 100, 1, true);    var tween_gute = new Tween (gute_mc, "_alpha", Elastic, easeInOut, 0, 100, 1, true);    //*    home_mc._visible = false;    home_mc.unloadMovie();    club_mc._visible = false;    club_mc.unloadMovie()    //    gute_mc._visible = true;    //    stuff_mc._visible = false;    stuff_mc.unloadMovie()    kontakt_mc._visible = false;    kontakt_mc.unloadMovie()    news_mc._visible = false;    news_mc.unloadMovie()    adver_mc._visible = false;    adver_mc.unloadMovie()};


*****************************

Home.as

ActionScript Code:
stop ();//save_home.button_text_mc.button_text.text = "Submit to Home";see_home.button_text_mc.button_text.text = "See Home site";//see_home.onPress = function () {    loadText = new LoadVars ();    loadText.load ("home.txt");    loadText.onLoad = function () {        current_home.text = this.home;    };};//save_home.onRelease = function () {    getURL ("home.php", _blank, "POST");};


*****************************

Club.as

ActionScript Code:
//Show Database in the Data Grid.club_parseXML = function () {    if (myXML.hasChildNodes) {        //  we check if this xml has children just to be sure        var xmlRootNode = myXML.firstChild.childNodes;        // define the root of the xml file for easy navigation        for (var i = 0; i<xmlRootNode.length; i++) {            // now loop through the xml and fill our dataArray with objects            var thisNode = xmlRootNode[i];            if (thisNode != null) {                var strid = thisNode.childNodes[0].firstChild.nodeValue;                var strpic = thisNode.childNodes[1].firstChild.nodeValue;                var strtext = thisNode.childNodes[2].firstChild.nodeValue;                var strlink = thisNode.childNodes[3].firstChild.nodeValue;                // here we go, creating an object instantly and adding it to our container                arrDataGrid.push({ID:strid, Pic:strpic, Text:strtext, Link:strlink});            }        }    }    // this is where the magic is, link the filled array to the datagrid..... that's it!    // you'll have full control over what comes in to you grid! Great ain't it ;)    club_dg.dataProvider = arrDataGrid;};club_loadXML = function () {    arrDataGrid = new Array();    // will contain the data for the grid    myXML = new XML();    // loads the xml in memory    myXML.ignoreWhite = true;    // ignore enters and whitespace in xml file    myXML.onLoad = club_parseXML;    // reference to the function above    myXML.load("club_db.xml");    // the actual command which will load the xml file};//Finish Load Database in Data Grid.//*//Initial propertys.club_dg._visible = false;refresh_club._visible = false//*//Ckeck Box'es.// create event listener object for checkboxclubbox = new Object();// click event handlerclubbox.click = function() {    if (club_db.selected) {        club_dg._visible = true;        refresh_club._visible = true;        club_loadXML();    } else {        club_dg._visible = false;        refresh_club._visible = false;    }};// register the event listenerclub_db.addEventListener("click", clubbox);refresh_club.onPress = function () {    club_loadXML();}//Finish Show Database AS.//*//Remove ID MCremove_id_head._visible = false;remove_id_head2._visible = false;remove_id_input._visible = false;remove_club._visible = false;//// Check Boxremove_club_ac = new Object();// click event handlerremove_club_ac.click = function() {    if (remove_club_mc.selected) {        remove_id_head._visible = true;        remove_id_head2._visible = true;        remove_id_input._visible = true;        remove_club._visible = true;    } else {        remove_id_head._visible = false;        remove_id_head2._visible = false;        remove_id_input._visible = false;        remove_club._visible = false;    }};// register the event listenerremove_club_mc.addEventListener("click", remove_club_ac);///*//Alertimport mx.controls.Alert;// Define action after alert confirmation.var alertHandler:Function = function (evt_obj:Object) {    if (evt_obj.detail == Alert.YES)    {        getURL ("delete_club.php", _blank, "POST");    }};// Show alert dialog box.remove_club.onPress = function () {    var club_alert:Alert = Alert.show ("Do you want to remove ID:  " + remove_id_input.text + "?", "Validation Alert!", Alert.YES | Alert.NO, this, alertHandler, Alert.YES);    club_alert._x = 384.4;    club_alert._y = 334.5;};

*****************************

Gute.as

ActionScript Code:
//Show Database in the Data Grid.gute_parseXML = function () {    if (myXML.hasChildNodes) {        //  we check if this xml has children just to be sure        var xmlRootNode = myXML.firstChild.childNodes;        // define the root of the xml file for easy navigation        for (var i = 0; i<xmlRootNode.length; i++) {            // now loop through the xml and fill our dataArray with objects            var thisNode = xmlRootNode[i];            if (thisNode != null) {                var strid = thisNode.childNodes[0].firstChild.nodeValue;                var strpic = thisNode.childNodes[1].firstChild.nodeValue;                var strtext = thisNode.childNodes[2].firstChild.nodeValue;                var strlink = thisNode.childNodes[3].firstChild.nodeValue;                // here we go, creating an object instantly and adding it to our container                arrDataGrid.push({ID:strid, Pic:strpic, Text:strtext, Link:strlink});            }        }    }    // this is where the magic is, link the filled array to the datagrid..... that's it!    // you'll have full control over what comes in to you grid! Great ain't it ;)    gute_dg.dataProvider = arrDataGrid;};gute_loadXML = function () {    arrDataGrid = new Array();    // will contain the data for the grid    myXML = new XML();    // loads the xml in memory    myXML.ignoreWhite = true;    // ignore enters and whitespace in xml file    myXML.onLoad = gute_parseXML;    // reference to the function above    myXML.load("gute_db.xml");    // the actual command which will load the xml file};//Finish Load Database in Data Grid.//*//Initial propertys.gute_dg._visible = false;refresh_gute._visible = false//*//Ckeck Box'es.// create event listener object for checkboxgutebox = new Object();// click event handlergutebox.click = function() {    if (gute_db.selected) {        gute_dg._visible = true;        refresh_gute._visible = true;        gute_loadXML();    } else {        gute_dg._visible = false;        refresh_gute._visible = false;    }};// register the event listenergute_db.addEventListener("click", gutebox);refresh_gute.onPress = function () {    gute_loadXML();}//Finish Show Database AS.//*//Remove ID MCremove_id_head._visible = false;remove_id_head2._visible = false;remove_id_input._visible = false;remove_gute._visible = false;//// Check Boxremove_gute_ac = new Object();// click event handlerremove_gute_ac.click = function() {    if (remove_gute_mc.selected) {        remove_id_head._visible = true;        remove_id_head2._visible = true;        remove_id_input._visible = true;        remove_gute._visible = true;    } else {        remove_id_head._visible = false;        remove_id_head2._visible = false;        remove_id_input._visible = false;        remove_gute._visible = false;    }};// register the event listenerremove_gute_mc.addEventListener("click", remove_gute_ac);///*//Alertimport mx.controls.Alert;// Define action after alert confirmation.var alertHandler:Function = function (evt_obj:Object) {    if (evt_obj.detail == Alert.YES)    {        getURL ("delete_gute.php", _blank, "POST");    }};// Show alert dialog box.remove_gute.onPress = function () {    var gute_alert:Alert = Alert.show ("Do you want to remove ID:  " + remove_id_input.text + "?", "Validation Alert!", Alert.YES | Alert.NO, this, alertHandler, Alert.YES);    gute_alert._x = 384.4;    gute_alert._y = 334.5;};


*****************************

Stuff.as is the same like Club and Gute, only that instead of club or gute i stuff.


Here is the PHP code for the home, and club(the gute and stuff are the same, instead of club i have gute and stuff, and the link of the text input area and variable are ok)
Home.php

PHP Code:



<?PHP$text = $_POST['input_home_text'];$fol = fopen ("home.txt",w);$sentOk = fwrite ($fol,"home=".$text);?>




*****************************

Club.php (submit_club.php)

PHP Code:



<?php//CLUB PHP SCRIPT////Variabile Flash.$locatie = $_POST['town'];$nume = $_POST['name'];$url = $_POST['link'];$id = $_POST['id_update'];//Variabile Locale.$username = "root";$password = "";$database = "electrotown";//Connectare la Database.$connect = mysql_connect("localhost",$username,$password) or trigger_error(mysql_error(),E_USER_ERROR);mysql_select_db($database);//Updatare Database.$update = "UPDATE club SET oras = '$locatie', nume = '$nume', link ='$url' WHERE id = '$id'" or die(mysql_error());mysql_query($update);//Scriere XML.$query = mysql_query("SELECT * FROM club ORDER BY id ASC");$xml = "<data>
";while ( $i = mysql_fetch_array($query)) {$xml = $xml . " <row>
";$xml = $xml . " <id>";$xml = $xml . $i['id'];$xml = $xml . "</id>
";$xml = $xml . " <oras>";$xml = $xml .$i['oras'];$xml = $xml . "</oras>
";$xml = $xml . " <nume>";$xml = $xml .$i['nume'];$xml = $xml . "</nume>
";$xml = $xml . " <link>";$xml = $xml .$i['link'];$xml = $xml . "</link>
";$xml = $xml . " </row>

";}$xml = $xml . "</data>";$fol = fopen("club_db.xml",w);$fold = fwrite($fol,$xml);//Scriere mesaj.echo "<center><font size = 3>Datele au fost updatate cu succes in:<b> ".$database."</b>.</font></center><br>";echo "<center>Datele: <b>".$locatie." </b>, <b>".$nume."</b> , <b>".$url."</b> au fost updatate in database-ul: <b>".$database."</b>.</center>";//Inchidere XML si Database.fclose ($fol);mysql_close($connect);?><script language="javascript">window.close();</script>



*****************************

Club.php (update_club.php)

PHP Code:



<?php//CLUB PHP SCRIPT////Variabile Flash.$locatie = $_POST['town'];$nume = $_POST['name'];$url = $_POST['link'];$id = $_POST['id_update'];//Variabile Locale.$username = "root";$password = "";$database = "electrotown";//Connectare la Database.$connect = mysql_connect("localhost",$username,$password) or trigger_error(mysql_error(),E_USER_ERROR);mysql_select_db($database);//Updatare Database.$update = "UPDATE club SET oras = '$locatie', nume = '$nume', link ='$url' WHERE id = '$id'" or die(mysql_error());mysql_query($update);//Scriere XML.$query = mysql_query("SELECT * FROM club ORDER BY id ASC");$xml = "<data>
";while ( $i = mysql_fetch_array($query)) {$xml = $xml . " <row>
";$xml = $xml . " <id>";$xml = $xml . $i['id'];$xml = $xml . "</id>
";$xml = $xml . " <oras>";$xml = $xml .$i['oras'];$xml = $xml . "</oras>
";$xml = $xml . " <nume>";$xml = $xml .$i['nume'];$xml = $xml . "</nume>
";$xml = $xml . " <link>";$xml = $xml .$i['link'];$xml = $xml . "</link>
";$xml = $xml . " </row>

";}$xml = $xml . "</data>";$fol = fopen("club_db.xml",w);$fold = fwrite($fol,$xml);//Scriere mesaj.echo "<center><font size = 3>Datele au fost updatate cu succes in:<b> ".$database."</b>.</font></center><br>";echo "<center>Datele: <b>".$locatie." </b>, <b>".$nume."</b> , <b>".$url."</b> au fost updatate in database-ul: <b>".$database."</b>.</center>";//Inchidere XML si Database.fclose ($fol);mysql_close($connect);?><script language="javascript">window.close();</script>



*****************************

Club.php (delete_club.php)

PHP Code:



<?php//CLUB PHP SCRIPT////Variabile Flash.$id = $_POST['id_remove'];//Variabile Locale.$username = "root";$password = "";$database = "electrotown";//Connectare la Database.$connect = mysql_connect("localhost",$username,$password) or trigger_error(mysql_error(),E_USER_ERROR);mysql_select_db($database);//Stergere ID din Database.//"DELETE FROM gute WHERE id = '$id'" or die(mysql_error());$delete = "DELETE FROM club WHERE id = '$id'" or die(mysql_error());mysql_query($delete);//Scriere XML.$query = mysql_query("SELECT * FROM club ORDER BY id ASC");$xml = "<data>
";while ( $i = mysql_fetch_array($query)) {$xml = $xml . " <row>
";$xml = $xml . " <id>";$xml = $xml . $i['id'];$xml = $xml . "</id>
";$xml = $xml . " <oras>";$xml = $xml .$i['oras'];$xml = $xml . "</oras>
";$xml = $xml . " <nume>";$xml = $xml .$i['nume'];$xml = $xml . "</nume>
";$xml = $xml . " <link>";$xml = $xml .$i['link'];$xml = $xml . "</link>
";$xml = $xml . " </row>

";}$xml = $xml . "</data>";$fol = fopen("club_db.xml",w);$fold = fwrite($fol,$xml);//Scriere mesaj.echo "<center><font size = 3>ID-ul:<b> ".$id."</b> a fost sters din Database.</font></center><br>";//Inchidere XML si Database.fclose ($fol);mysql_close($connect);?><script language="javascript">window.close();</script>



*****************************


When access a page (club_mc for exemple) and i write something everything goes ok, BUT when i access the second page (gute_mc) and i write something and i click SUBMIT the PHP is opened in a new window (this is ok) but nothing is writen down in the database, then the site is crashed!!!

Can you help me, you can see the exemple here:
http://www.electrotown.de/test

Thank you in advanced, Tiberiu!

Php,mysql
hello all,

i am trying to connect php to a mysql database by doing the following:

$con = mysql_connect("localhost:8080","username","passwor d");

when i try to run the php file in the browser it takes forever to load.

What could be the problem? and what am i doing wrong.

i created the database with mysql in xampp. pls help me out.

thanx
korkor5

XML Vs/or/and MySQL
Hi all,

I have a flash page which contains products, each product has the same heading, i.e. Price, Description, Availability... If I were doing this without Flash normally I'd build a PHP page and use a MySQL database... This still seems like the best option to me even in Flash, although a few people have told me I should set up a XML file which I can change and that would update the images and text, but isn't that why I would have a MySQL database? Wouldn't I change it on the server side and Flash would update it that way?

Not really understanding why we need XML and and how it benefits us when we could be using a MySQL db...

Thanks all in advance!

AS PHP/MYSQL Help
Hi,

I'm just beginning to work on flash and actionscript. I just finished working on a simple quiz game and I'd like to integrate with a current php/mysql script. How can I send/pass the score variable from the flash quiz to a php page so I can add the points to the user? thanks

Copyright © 2005-08 www.BigResource.com, All rights reserved