Flash/PHP/mySQL Trouble
Hi all I'm having trouble connecting flash to my database through php -
i have a table (siteData) set up with 4 rows sectionID(primary key + auto-increment), sectionTitle, sectionText, sectionImage - which have info in the database.
I have 2 php files - common.php (includes/common.php) - which contains the connection info:
Code:
<? // Database details $dbHost = "mysql11.myhost.net"; $dbUser = "myusername"; $dbPass = "myPaSsWoRd"; $dbName = "mydatabasename"; /********************************************************* ** Function: dbconnect() ** ** Desc: Perform database server connection and ** ** database selection operations ** *********************************************************/ function dbConnect() { // Access global variables global $dbHost; global $dbUser; global $dbPass; global $dbName; // Attempt to connect to database server $link = @mysql_connect($dbHost, $dbUser, $dbPass);
// If connection failed... if (!$link) { // Inform Flash of error and quit fail("Couldn't connect to database server"); }
// Attempt to select our database. If failed... if (!@mysql_select_db($dbName)) { // Inform Flash of error and quit fail("Couldn't find database $dbName"); } return $link; }
/********************************************************* ** Function: fail() ** ** Params: $errorMsg - Custom error information ** ** Desc: Report error information back to Flash ** ** movie and exit the script. ** *********************************************************/ function fail($errorMsg) { // Output error information and exit print $errorMsg; exit; }
?>
in the second - returnData.php (root) - which calls the connection and finds the row and pulls off two rows and sends them back to flash in the Vars theText & theImage
Code:
<? include("includes/common.php"); $link=dbConnect(); $theRow=$_POST['row']; $query="SELECT * FROM siteData WHERE sectionID=$theRow"; $result=mysql_query($query); $row=mysql_fetch_array($result); $theText=$row['sectionText']; $theImage=$row['sectionImage']; echo "&theText=$theText&theImage=$theImage"; ?>
and i have my swf file which is in the root which has 2 movie clips a buttons template (buttons) and an empty movie clip (empty) to hold the image and a dynamic text field with the instance name "data_txt" the buttons have the instance names "home_btn", "about_btn", "news_btn" and "contact_btn" - and the actionscript layer contains the following:
Code:
myLoadVars = new LoadVars(); myLoadVars.onLoad = function(ok) { if (ok) { data_txt.text = this.theText; imageHolder_mc.loadMovie('images/'+this.theImage); } else { data_txt.text = 'Error'; } }; function loadData(sectionID) { myLoadVars.row = sectionID; myLoadVars.sendAndLoad('returnData.php', myLoadVars, 'POST'); } home_btn.onRelesase = function() { loadData(1); } about_btn.onRelesase = function() { loadData(2); } news_btn.onRelesase = function() { loadData(3); } contact_btn.onRelesase = function() { loadData(4); }
I cant see where i am going wrong please help or point me in the right direction.
Thanks
DevShed > Flash Help
Posted on: June 9th, 2006, 10:27 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
- Flash/PHP/mySQL Trouble
- USING FLASH MYSQL PHP TUTORIAL TROUBLE
- Trouble With The PHP/MySQL/Flash Tutorial
- USING FLASH MYSQL PHP TUTORIAL TROUBLE
- Flash And PHP/MYSQL Database Text Trouble
- Trouble Fetching Images And Text With ASP From MySQL
- Trouble Fetching Images And Text With ASP From MySQL
- Export Querries From Flash 8 To MySQL And Import Data From MySQL
- Php,mysql And Flash- How To Display Picture In Flash From Mysql
- [FL8 + PHP + MySQL] Adding/Deleting/Viewing Content From MySQL Db
- PHP + Mysql Ind Flash 5
- Flash And MySQL
- Flash - Php - Mysql
- Flash MX And MySQL
- Flash And MySQL
- Flash And MySQL
- Flash MX + PHP/MySql
- HELP Flash, PHP And MySQL Db.
- Flash MX, PHP And MySQL.
- Flash MX, MySQL, ASP 2.0
- Flash PHP MYSQL HELP
- Flash+php+mysql
- Flash, Php And Mysql
- Flash And MySQL
- Flash MX + PHP + MySQL
- Flash To Php To MySql
- Flash And MySQL
- Flash Mx, Php, Mysql
- PHP, MySQL And FLASH
- MySQL - Flash MX
- Flash, PHP, And MySQL
- MySQL And Flash
- Mysql, Sql, Php, And Flash
- Flash Mx +php + Mysql?
- Flash MX And PHP & MySQL
- A Little Flash/MySQL Help...
- MySQL And Flash?
- Flash & Mysql
- Flash, PHP, MySQL
- Flash Php And Mysql
- MySQL In Flash
- Help Me.. Need A Little Help (Mysql, PHP And Flash)
- Flash, PHP & MySQL?
- PHP/MYSQL Flash
- Mysql -> Flash
- Flash And MySQL.
- Flash 8 / PHP / MySQL Help Please
- MySQL->PHP->FLASH
- PHP / Mysql And Flash
Flash/PHP/mySQL Trouble
i all I'm having trouble connecting flash to my database through php -
i have a table (siteData) set up with 4 rows sectionID(primary key + auto-increment), sectionTitle, sectionText, sectionImage - which have info in the database.
I have 2 php files - common.php (includes/common.php) - which contains the connection info:
Code:
<?
// Database details
$dbHost = "mysql11.myhost.net";
$dbUser = "myusername";
$dbPass = "myPaSsWoRd";
$dbName = "mydatabasename";
/*********************************************************
** Function: dbconnect() **
** Desc: Perform database server connection and **
** database selection operations **
*********************************************************/
function dbConnect() {
// Access global variables
global $dbHost;
global $dbUser;
global $dbPass;
global $dbName;
// Attempt to connect to database server
$link = @mysql_connect($dbHost, $dbUser, $dbPass);
// If connection failed...
if (!$link) {
// Inform Flash of error and quit
fail("Couldn't connect to database server");
}
// Attempt to select our database. If failed...
if (!@mysql_select_db($dbName)) {
// Inform Flash of error and quit
fail("Couldn't find database $dbName");
}
return $link;
}
/*********************************************************
** Function: fail() **
** Params: $errorMsg - Custom error information **
** Desc: Report error information back to Flash **
** movie and exit the script. **
*********************************************************/
function fail($errorMsg) {
// Output error information and exit
print $errorMsg;
exit;
}
?>
in the second - returnData.php (root) - which calls the connection and finds the row and pulls off two rows and sends them back to flash in the Vars theText & theImage
Code:
<?
include("includes/common.php");
$link=dbConnect();
$theRow=$_POST['row'];
$query="SELECT * FROM siteData WHERE sectionID=$theRow";
$result=mysql_query($query);
$row=mysql_fetch_array($result);
$theText=$row['sectionText'];
$theImage=$row['sectionImage'];
echo "&theText=$theText&theImage=$theImage";
?>
and i have my swf file which is in the root which has 2 movie clips a buttons template (buttons) and an empty movie clip (empty) to hold the image and a dynamic text field with the instance name "data_txt" the buttons have the instance names "home_btn", "about_btn", "news_btn" and "contact_btn" - and the actionscript layer contains the following:
Code:
myLoadVars = new LoadVars();
myLoadVars.onLoad = function(ok) {
if (ok) {
data_txt.text = this.theText;
imageHolder_mc.loadMovie('images/'+this.theImage);
} else {
data_txt.text = 'Error';
}
};
function loadData(sectionID) {
myLoadVars.row = sectionID;
myLoadVars.sendAndLoad('returnData.php', myLoadVars, 'POST');
}
home_btn.onRelesase = function() {
loadData(1);
}
about_btn.onRelesase = function() {
loadData(2);
}
news_btn.onRelesase = function() {
loadData(3);
}
contact_btn.onRelesase = function() {
loadData(4);
}
I cant see where i am going wrong please help or point me in the right direction.
Thanks
USING FLASH MYSQL PHP TUTORIAL TROUBLE
I thought I might avail of your offer for some help on your tutorial "Use Flash with PHP and mySQL"http://www.kirupa.com/developer/actionscript/flash_php_mysql.htm
I am not returning any text from my database into my textfield (with the variable name 'content') and wonder if you can locate anything obvious in the process I have done.
I am using phpmyadmin remotely
my mySQL database table is called 'files' and my database is called 'myweb318235_colum'
I have two files in the table
Host: lalalalala.com
Database : bababababa_baba
Generation Time: Jan 03, 2005 at 10:28 PM
Generated by: phpMyAdmin 2.5.4
SQL-query: SELECT * FROM `files` LIMIT 0, 30;
filename content testfile [BLOB - 36 Bytes] testfile2 [BLOB - 61 Bytes]
my flash files are called bigphpmysqltest.fla and bigphpmysqltest.swf
in bigphpmysqltest.swf I have the dynamic text field with variable = content which is saved amovieclip with this actionscript
onClipEvent (load) {
loadVariables("read.php?file=testfile", this, "GET");
}
the php file is called 'read.php'
<?php
if($file) {
$link = mysql_connect("hostname","username","password","da tabasename") or die ("didn't connect to mysql");
$query = "SELECT content FROM files WHERE filename='$file'";
$result = mysql_query($query)
or die("<b>error</b>: failed to execute query <i>$query</i>");
mysql_close($link);
$desiredContent = mysql_fetch_array($result, MYSQL_ASSOC);
mysql_free_result($result);
print "content=$desiredContent[content]";
?>
files is the table in the database
It just doesn't work unfortunately - I have been intouch to my server people to check if my register_globals was on but they couldn't help.
Unfortunately I am a very novice beginner in this and if nothing is obvious in the above, how would I use $HTTP_POST_VARS into the php file?
I would so appreciate your help!
Thanks in advance.
CollyK
Trouble With The PHP/MySQL/Flash Tutorial
The one found here is giving me grief!
I've modified the code to work with Pear, since I had it installed. However, I can't get the code to work. The consolation is I can't get the original code to work, either.
You can find the original code's results here:
The PHP file
The Swf File
The HTML page
My modigied versions are here:
The PHP file (You can see it is connecting to the database and recovering the data)
The SWF file
The HTML page (obviously just as blank as the SWF)
Since neither one works, I'm going to assume (for the moment) that the problem lies in the implementation of my SWF somewhere. Anyone have any ideas whatsoever?
Thanks.
P.S Using Flash MX 2004
USING FLASH MYSQL PHP TUTORIAL TROUBLE
I thought I might avail of your offer for some help on your tutorial "Use Flash with PHP and mySQL"http://www.kirupa.com/developer/actionscript/flash_php_mysql.htm
I am not returning any text from my database into my textfield (with the variable name 'content') and wonder if you can locate anything obvious in the process I have done.
I am using phpmyadmin remotely
my mySQL database table is called 'files' and my database is called 'myweb318235_colum'
I have two files in the table
Host: lalalalala.com
Database : bababababa_baba
Generation Time: Jan 03, 2005 at 10:28 PM
Generated by: phpMyAdmin 2.5.4
SQL-query: SELECT * FROM `files` LIMIT 0, 30;
filename content testfile [BLOB - 36 Bytes] testfile2 [BLOB - 61 Bytes]
my flash files are called bigphpmysqltest.fla and bigphpmysqltest.swf
in bigphpmysqltest.swf I have the dynamic text field with variable = content which is saved amovieclip with this actionscript
onClipEvent (load) {
loadVariables("read.php?file=testfile", this, "GET");
}
the php file is called 'read.php'
<?php
if($file) {
$link = mysql_connect("hostname","username","password","da tabasename") or die ("didn't connect to mysql");
$query = "SELECT content FROM files WHERE filename='$file'";
$result = mysql_query($query)
or die("<b>error</b>: failed to execute query <i>$query</i>");
mysql_close($link);
$desiredContent = mysql_fetch_array($result, MYSQL_ASSOC);
mysql_free_result($result);
print "content=$desiredContent[content]";
?>
files is the table in the database
It just doesn't work unfortunately - I have been intouch to my server people to check if my register_globals was on but they couldn't help.
Unfortunately I am a very novice beginner in this and if nothing is obvious in the above, how would I use $HTTP_POST_VARS into the php file?
I would so appreciate your help!
Thanks in advance.
CollyK
Flash And PHP/MYSQL Database Text Trouble
Hello, I am trying to put together a web site that takes ALL content from the MYSQL database and displays it in dynamic text boxes...
I am having no trouble getting the variables from PHP, it is just a problem of storing those variables so taht they can be used later. Problem is displayed here:
http://test.un-identified.com/gateway/index.html
click through all 3 buttons -- make sure it loads the content, after you have clicked through all three, try clicking them again -- the content does not show up and i cannot figure out why -- or a solution to it.
here is the function to get the content when given a page title.
Code:
function get_page(page_title){
//creates a new loadVars object with the title of requested page, then returns
// with the page content to put inside the text box
content = new LoadVars();
content.page_title = page_title;
content.onLoad = function(success) {
if (success){
// enters recieved content into text box
_root.content_box.scrollerText.htmlText = this.content; } else{
trace("Problems...");
}
}
content.sendAndLoad("http://test.un-identified.com/gateway/php/display_page.php?uniqueID=" + getTimer() , content, "POST");
}
Here is some button code that calls the function with the desierd page title as a parameter:
Code:
on (release) {
_root.get_page("Home");
}
(also: the 'loading' is just another variable i load with LoadVars everytime a button is clicked (before the get_page() function is called) so as to make sure the text box reloads with new content each time --is there a real way to check if the content is loaded, and possibly use a loading bar for this type of dynamic content?)
Thanks
Trouble Fetching Images And Text With ASP From MySQL
I have a system where a user can go in and change the information of their site. The user writes the text and add images and it gets saved as html tags in a MySQL database.
I need to use this system togeather with flash now. I load an ASP file into a dynamic textfield and it works great with text. I use
myVars.load("http://www.localhost/rambo/scripts/main.asp?pageId=2");
to fetch the info.
I also want to display images. If i use the line
<IMG src="images/text.jpg" >
in the database i works great, but i need to use the line
<IMG src="imageShow.asp?id=6">
This doesnt work, just leave a white area where the image should be.
Deadline is ticking so...HEEEELP!!!
Thanks in advance!
Trouble Fetching Images And Text With ASP From MySQL
I have a system where a user can go in and change the information of their site. The user writes the text and add images and it gets saved as html tags in a MySQL database.
I need to use this system togeather with flash now. I load an ASP file into a dynamic textfield and it works great with text. I use
myVars.load("http://www.localhost/rambo/scripts/main.asp?pageId=2");
to fetch the info.
I also want to display images. If i use the line
<IMG src="images/text.jpg" >
in the database i works great, but i need to use the line
<IMG src="imageShow.asp?id=6">
This doesnt work, just leave a white area where the image should be.
Deadline is ticking so...HEEEELP!!!
Thanks in advance!
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 ?
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,
[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 Ind Flash 5
Hey there, this is very important for me, so pleeeaaaaaseeeeee.....
I have a question concerning php4 and mysql.
Is there a possibility to use flash to get information or better to say databases from mysql and display, delete, change and use them through flash 5 in a swf-file (maybe as variables)?
And can I use php to write it into a mysql-database and use it in flash 5?
thanx a lot
jean3k
Flash - Php - Mysql
hi everybody,
i have a serious problem, and i would really appreciate if someone could give me some help.
I created a flash eCard application with the use of actionscript, php and mysql.
you can view the application at: http://www.acidvision.com/eflyer
in this application the user can login, create a fully customised eflyer and finally save it to a database or send it to an email address.
when the user clicks on the send button the variables are being saved to an mysql table with a unique id and a php url is created so the recipient can click on this url and view the flyer. So far so good.
Now the problem:
the recipient receives the message that he has a flashCard which can view under the url:
http://www.acidvision.com/eflyer/vie...p?flyerid=(the flyer id number generated by the send action.)
When the recipient clicks on this link, the webpage is loading normally, the variables are loading from the database, but THEY ARE NOT PASSED INTO THE FLASH MOVIE.
In this viewflyer.php file resides the flash movie which with a loadVariables function is trying to load the variables from the viewflyer.php
Here i have the php code i use for the view flyer.
<?
mysql_connect("localhost","","");
mysql_select_db("aveflyer");
$result=mysql_query("SELECT * FROM flyerssend WHERE flyerid='$flyerid'");
while ($row = mysql_fetch_array($result)){
$layerNumber = $row['layerNumber'];
$dragging = $row['dragging'];
$shapeAlpha = $row['valuesLayer1shapealpha'];
$shapeAlpha2 = $row['valuesLayer2shapealpha'];
$shapeAlpha3 = $row['valuesLayer3shapealpha'];
$xScale = $row['valuesLayer1xScale'];
$xScale2 = $row['valuesLayer2xScale'];
$xScale3 = $row['valuesLayer3xScale'];
$yScale = $row['valuesLayer1yScale'];
$yScale2 = $row['valuesLayer2yScale'];
$yScale3 = $row['valuesLayer3yScale'];
$xSkew = $row['valuesLayer1xSkew'];
$xSkew2 = $row['valuesLayer2xSkew'];
$xSkew3 = $row['valuesLayer3xSkew'];
$ySkew = $row['valuesLayer1ySkew'];
$ySkew2 = $row['valuesLayer2ySkew'];
$ySkew3 = $row['valuesLayer3ySkew'];
$melt = $row['valuesLayer1melt'];
$melt2 = $row['valuesLayer2melt'];
$melt3 = $row['valuesLayer3melt'];
$Spacing = $row['valuesLayer1Spacing'];
$Spacing2 = $row['valuesLayer2Spacing'];
$Spacing3 = $row['valuesLayer3Spacing'];
$ShapeRed = $row['valuesLayer1ShapeRed'];
$ShapeRed2 = $row['valuesLayer2ShapeRed'];
$ShapeRed3 = $row['valuesLayer3ShapeRed'];
$ShapeGreen = $row['valuesLayer1ShapeGreen'];
$ShapeGreen2 = $row['valuesLayer2ShapeGreen'];
$ShapeGreen3 = $row['valuesLayer3ShapeGreen'];
$ShapeBlue = $row['valuesLayer1ShapeBlue'];
$ShapeBlue2 = $row['valuesLayer2ShapeBlue'];
$ShapeBlue3 = $row['valuesLayer3ShapeBlue'];
$rotate = $row['valuesLayer1rotate'];
$rotate2 = $row['valuesLayer2rotate'];
$rotate3 = $row['valuesLayer3rotate'];
$xPosition = $row['valuesLayer1xPosition'];
$xPosition2 = $row['valuesLayer2xPosition'];
$xPosition3 = $row['valuesLayer3xPosition'];
$yPosition = $row['valuesLayer1yPosition'];
$yPosition2 = $row['valuesLayer2yPosition'];
$yPosition3 = $row['valuesLayer3yPosition'];
$matrix = $row['matrix'];
$matrix2 = $row['matrix2'];
$matrix3 = $row['matrix3'];
$shape = $row['shape'];
$shape2 = $row['shape2'];
$shape3 = $row['shape3'];
$bg = $row['bg'];
$bgR = $row['bgR'];
$bgG = $row['bgG'];
$bgB = $row['bgB'];
$zoom = $row['zoom'];
$layer1vis = $row['layer1Vis'];
$layer2vis = $row['layer2Vis'];
$layer3vis = $row['layer3Vis'];
$theL1Click = $row['theL1Click'];
$theL2Click = $row['theL2Click'];
$theL3Click = $row['theL3Click'];
print "&layerNumber=" . urlencode($layerNumber);
print "&dragging=" . urlencode($dragging);
print "&shapeAlpha=" . urlencode($shapeAlpha);
print "&shapeAlpha2=" . urlencode($shapeAlpha2);
print "&shapeAlpha3=" . urlencode($shapeAlpha3);
print "&xScale=" . urlencode($xScale);
print "&xScale2=" . urlencode($xScale2);
print "&xScale3=" . urlencode($xScale3);
print "&yScale=" . urlencode($yScale);
print "&yScale2=" . urlencode($yScale2);
print "&yScale3=" . urlencode($yScale3);
print "&xSkew=" . urlencode($xSkew);
print "&xSkew2=" . urlencode($xSkew2);
print "&xSkew3=" . urlencode($xSkew3);
print "&ySkew=" . urlencode($ySkew);
print "&ySkew2=" . urlencode($ySkew2);
print "&ySkew3=" . urlencode($ySkew3);
print "&melt=" . urlencode($melt);
print "&melt2=" . urlencode($melt2);
print "&melt3=" . urlencode($melt3);
print "&Spacing=" . urlencode($Spacing);
print "&Spacing2=" . urlencode($Spacing2);
print "&Spacing3=" . urlencode($Spacing3);
print "&ShapeRed=" . urlencode($ShapeRed);
print "&ShapeRed2=" . urlencode($ShapeRed2);
print "&ShapeRed3=" . urlencode($ShapeRed3);
print "&ShapeGreen=" . urlencode($ShapeGreen);
print "&ShapeGreen2=" . urlencode($ShapeGreen2);
print "&ShapeGreen3=" . urlencode($ShapeGreen3);
print "&ShapeBlue=" . urlencode($ShapeBlue);
print "&ShapeBlue2=" . urlencode($ShapeBlue2);
print "&ShapeBlue3=" . urlencode($ShapeBlue3);
print "&rotate=" . urlencode($rotate);
print "&rotate2=" . urlencode($rotate2);
print "&rotate3=" . urlencode($rotate3);
print "&xPosition=" . urlencode($xPosition);
print "&xPosition=" . urlencode($xPosition);
print "&xPosition2=" . urlencode($xPosition2);
print "&yPosition3=" . urlencode($yPosition3);
print "&matrix=" . urlencode($matrix);
print "&matrix2=" . urlencode($matrix2);
print "&matrix3=" . urlencode($matrix3);
print "&shape=" . urlencode($shape);
print "&shape2=" . urlencode($shape2);
print "&shape3=" . urlencode($shape3);
print "&bg=" . urlencode($bg);
print "&bgR=" . urlencode($bgR);
print "&bgG=" . urlencode($bgG);
print "&bgB=" . urlencode($bgB);
print "&zoom=" . urlencode($zoom);
print "&layer1vis=" . urlencode($layer1vis);
print "&layer2vis=" . urlencode($layer2vis);
print "&layer3vis=" . urlencode($layer3vis);
print "&theL1Click=" . urlencode($theL1Click);
print "&theL2Click=" . urlencode($theL2Click);
print "&theL3Click=" . urlencode($theL3Click);
}
mysql_close();
?>
<html>
<head>
<title>Preview</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css/styles.css">
</head>
<BODY bgcolor="#FFFFFF">
<OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="795" HEIGHT="573" id="view" ALIGN="">
<PARAM NAME=movie VALUE="view.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="view.swf" quality=high bgcolor=#FFFFFF WIDTH="795" HEIGHT="573" NAME="viewflyer" ALIGN=""
TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT>
</BODY>
</html>
Is there something that I'm doing wrong?
thanks in advance
fotios
my mail is: fotis@freesurf.ch
Flash MX And MySQL
could somebody help me figuring out how to connect Flash MX with MySQL database? i have created a database in MySQL that contains information for car parts. what i would like to do is retrieving certain part information from this database (including an accompaniment image for that particular car part too)and having them display within my Flash MX movie when a button is clicked.
i know there are things involved such as PHP scripting to establish the connection between Flash and MySQL as well as creating an empty movie clip to hold the image. nevertheless, i'm still confused as how to get it to work?
thanks for your help!
Flash And MySQL
Hello guys.
Question:
I have transfer data form flash to MySQL and again to flash as soon as it possible:
Flash(text1 field)->MySQL (save “text1” in the database field “text” and return to flash as text2. We read this again from “text” field of database)->Flash
P.S. text1 and text2 field in the _root.charactermovie of cause.
Here is a flash-script for _root.charactermovie:
onClipEvent (enterFrame) {
loadVariables("text.php", "_root.charactermovie", "POST");
}
enterFrame event to cycle event of cause.
Php-script:
<?php
require( "function.php" );
$dbLink = mysql_connect( $dbHost, $dbUser, $dbPass );
dbConnect();
mysql_query( "UPDATE text SET text='$text1' where id = 1;" );
$result = mysql_query( "SELECT text FROM text where id='1'" );
$row = mysql_fetch_array( $result );
$text2=$row['text'];
echo "text2=".$text2;
?>
All is working, but… with such slow speed…it’s refresh in 1 sec or even worth.
Is there flash problem or is there mistake in my head? :-)
Regards,
Alex
Flash MX + PHP/MySql
Anyone have any experience linking an external mysql database to a Flash movie? Sample urls?
HELP Flash, PHP And MySQL Db.
I am in desperate need of help about my situation. I need to have a web page that has a flash with a gif. embeded in it. The images are generated at random from a MySQL database using PHP. I also need to display an animated text that corresponds to the image displayed. If any one out there can help, please.
Flash MX, MySQL, ASP 2.0
Hello!
I was just curious as to whether it were possible to run queries in Flash to MySQL using ASP as the server tech.
Cheers.
Flash+php+mysql
I need to insert and retrieve data from a mysql DB, the problem is when I’m listing data that as the character & flash assumes that as a new variable.
I could escape() the text before insert to de DB and the problem will be solved but I also need to have some html entities to make links in the text.
Suppose I have this text:
this is the example text fallowed by a link www.flashkit.com and some special characters & <b>bold</>
What I need:
Show the text exactly as you see it
Without making the bold
Without assume the character & as a new variable
Assuming the www.flashkit.com as a link
Any suggestions will be appreciated
Thanks
Flash, Php And Mysql
Well, according to the lack of tutorials (more like none whatsoever!) I have managed to achieve the impossible, MULTIPAGE FORMS ON FLASH.
At the moment, i have the data passed to php which sends me the results in the form of an email.
My question is,, since i know nothing about PHP, and my manual budget has been exceeded with the expenditure on flash bibles, does any one have an example of some code that i can put into an existing php file so that it passes the info to a MYSQL DB on my server.
for this example u can use the DB name FORMDATA. with ;
$name
$contact
$address
I would really appreciate the help
Flash And MySQL
Now, I know that flash can work with MySQL but it has to go through a php script in the process. Correct?
Can Flash communicate directly with MySQL.
Flash MX + PHP + MySQL
I know a bittle bit of all theese tools, but I have a problem making them work toghether.
if someone could make a *.fla and a *.php source that would do the following thing :
- in the flash movei I have a input text, a dynamic one and a button
- I write in the input a sql query and push the button
- the php script recives the command and executes it and returns to the same flash movie the results
- the flash movie displays the result in the dynamic text box.
please send me the *.fla and *.php sources at FenixSA_@hotmail.com.
Thankyou very-very much and please don't close/delete my thread because I didn't know where else to turn to..I found some tutorials on the net but I didn't understand all of the script..and I didn't try very hard to understand because the exemple files did'n work !!
Flash To Php To MySql
I have a flash movie where i want a user to submit their name and email address to the database.
Flash:
Name text field variable: name
Email text field variable: email
Go Button (Submit Button and it a movie on top of a movie)
on (release) {
Status = "Registration Done";
loadVariablesNum"../php/Register.php?name="+name",1, "POST");
gotoAndPlay(2);
}
PHP:
<?php
$Host="localhost";
$User="*****";
$Passwd="****";
$DBName="executiveentbiz_com_-_guestlist"
$TableName="glist";
$name="name";
$email="email";
mysql_connect($Host, $User, $Passwd);
mysql_select_db(executiveentbiz_com_-_guestlist);
$Query="INSERT INTO glist (name, email) VALUES('name', 'email')";
mysql_query($Query, $ Connect);
?>
Flash And MySQL
I need to get Flash to read from mySQL. I know from looking at several web site and tutorials, that generally PHP is used as an intermediary to pass things back and forth from Flash to the database. This is usually done because the information passed needs to be displayed on the Flash page.
What I'm doing is a little different, in that I am getting information from mySQL that will be largely 8-10 bit binary numbers (keyed by date in mySQL). The numbers are actually representing some environmental information collected on a remote site using various sensors and passed to the database from LabView through Kermit to mySQL. I need to get these values into Flash, but not for use as text, just as variables, so that I can do something like [RED]if(value == 00010000) {some_function();}[/RED].
My question: Is it possible to use loadVars() or something else to read directly from the database instead of using PHP in the middle? Or can I use to read sequentially from a text file? I'm continuing to research this on my own, but I figured I'd toss up the quesiton in the interest of shortcutting the process.
Thanks in advance.
Flash Mx, Php, Mysql
Hi, does anyone know of any good resources that deal with the interaction between flash mx, php and mysql. What i specifically am looking at doing is just creating a simple membership signup that allows a user to enter details into a text area in a flash movie and post these to a php file that will input them into a database.
Thanks.
PHP, MySQL And FLASH
Hey everyone,
I have been using PHP with mySQL in the development of sites for a few years now but, want to incorporate it into my flash sites. Problem is I have not been able to find any good books (manuals) that specialize in this area. Yeah, there is a little bit about it in lots of books but, I am looking for something more directly addressing this area.
Anyone have any suggestions?
MySQL - Flash MX
Hello!
Can anyone briefly explain to me the dynamics on how to have a Flash-site interact with data stored in a Mysql database?
Response much appreciated.
MAB71
Flash, PHP, And MySQL
I've been programming in PHP/MySQL for awhile now, and want to start getting data from a MySQL database every few seconds, without a refresh, but have a few questions:
First of all, HOW do I do this? Can flash call up php files just like a regular user, but instead of sending the data to the user - its sent to the flash, and everything needed is taken out? Is there an actual description of how this works, and some example code out there (Not on flashkit, I've looked through all the tutorials and I don't want my hand held through all of this :P, I'd rather have it explained in full ... I'm picky)
Secondly: How would I keep the data refreshing, and constantly up to date? Add header's to keep the data out of cache?
I'm new to flash, so I have no idea how to do all this; but I'd love to add more flash elements to my site
Information:
Flash MX
PHP: Newest production build
MySQL: Newest production build.
Thanks in advanced to anyone who can help me
MySQL And Flash
i want to use Flash MX 2004 Professional to read, edit, and add data to a MySQL database. What is the easiest way to do this. Also, its a linux server so no .asp Thanks
Mysql, Sql, Php, And Flash
OK i know that this night be a lil hard for me to ask.. so i will just say it as easy as i can... ok i got this tutorial from this site (not flashkit) and yes i have tried to get this question answered there but no response... anyway i got this tutorial from this site and i went through it nice and slow.. it is a user authintication flash /mysql/php well i got a windows advanced server 2000 with php up and running and mysql up and running.. i have this just to test flash stuff... anyway so i get ready to use it on a site.. i went to my web hosting company and i asked for my (mysql data base user name and password) well the admin asked me "what are you trying to do sir" you know how they get.. anyway i told him that i needed the info to put in a php file... so he tells me "just send me a backup copy of the data base and i will install it on the server" .. i was like huh... well as you can tell i know very little about mysql but some how i got it workin on my server without a back up copy so i told him i would just send him the .sql file with the tables on it...
this is what i sent;
CREATE TABLE tutorial_user_auth (
userID int(20) unsigned NOT NULL auto_increment,
userName varchar(15) NOT NULL default '0',
userPassword varchar(32) NOT NULL default '0',
userMail varchar(255) NOT NULL default '',
userQuestion varchar(255) NOT NULL default '',
userAnswer varchar(255) NOT NULL default '',
PRIMARY KEY (userID),
UNIQUE KEY userMail(userMail),
UNIQUE KEY userName(userName)
) TYPE=MyISAM;
well when i sent it to him he told me "this is for mysql running on a unix system we have a windows server running sql and the sytax is different" .. again i was like huh.. at this point i was thinking that i knew less about mysql then i do... so i asked him how could i make it so that the windows sql could handle the data base and he told me he did not know... well here i am now... confused and frustrated... i am attaching the files i got from the tutorial... some one please tell me how i can get him the back up for this data base in windows sql format... please i am on my knees begging for help with this one.... if you need more info to help you help me just let me know.. this is the site that i am trying to get this work on the site
i love yall
yo main man lenny
Flash Mx +php + Mysql?
Hello and thanks in advance...
i have been attempting to modify the following script:
Flash MX and PHP with MYSQL
besides content and query differences, instead of using buttons (tabs) i want the information to send and retrieve when a frame is entered. I don't know the correct syntax, but here is what i got so far:
actionscript in frame 3 of movieclip:
PHP Code:
// Stop the frame
stop ();
// Make sure no other panel was chosen
this.onEnterFrame = function () {
if (_global.showPanel != 1) {
gotoAndPlay (1);
}
};
// Set up new loadVars object
a = new LoadVars();
// Find out if user selected a Governate and send data to PHP
if (_global.gov == null) {
a.thisGov = "none";
a.sendAndLoad("areafind.php?thisGov="+a.thisGov, a);
_global.chosenGov = "You did not choose a specific <b>Governate</b>, if you wish to do so, please click on <b>Governate</b> above. Or you may choose an <b>area</b> below:";
} else {
a.thisGov = _global.gov;
a.sendAndLoad("areafind.php?thisGov="+a.thisGov, a);
_global.chosenGov = "You have chosen <b>" + a.thisGov + "</b>. Please choose the area:";
}
// Lay out returned data into textbox
function showAreas() {
var i;
content.htmlText = "";
for (i=0; i < this.n; i++) {
content.htmlText += "<b>" + this["area:"+i] + "</b><br>";
}
}
// Wait for returned data then run function
a.onLoad = showAreas;
and the PHP code:
PHP Code:
<?php
//Connection information
$dbhost = "localhost";
$dbuser = "********";
$dbpass = "********";
$dbname = "bahrainlocator";
// Connect to MySql
$connect = mysql_connect($dbhost, $dbuser, $dbpass)
or die("Unable to connect to MySql");
// Connect to Database
$db = mysql_select_db($dbname, $connect)
or die("Unable to connect to Database");
//query to run
if ($thisGov != 'none') {
$sql = "SELECT * FROM areas WHERE governates = '$thisGov'";
$result = mysql_query($sql)
or die("Unable to get list of areas");
}
else {
$sql = "SELECT * FROM areas";
$result = mysql_query($sql)
or die("Unable to get list of areas");
}
/*//count number of rows affected
$num_rows = mysql_num_rows($result);
for ($i = 0; $i <= $num_rows; $i++) {
$row = mysql_fetch_array($result);
echo $row['areas']."<br>";
}*/
//number of rows to display
$nrows = mysql_num_rows($result);
$rString = "&n=".$nrows."&";
for ($i=0; $i < $nrows; $i++) {
$row = mysql_fetch_array($result);
$rString .= $row['areas'];
}
echo $rString."&";
?>
to test that php was running the variable, i would use
PHP Code:
a.send("areafind.php?thisGov="+a.thisGov, a, "_blank");
and a new window would show up with the correct data.
im at a dead end. any suggestions?
PS. if anyone is wanting to get ahead of me.. they can suggest a way to place the returned data into a drop-down or select box!
Flash MX And PHP & MySQL
I want to make a flash movie and a php script whitch when loaded in the browser it loads a flash movie with the spesific users pictures in a slide show from a mySQL database, like this:
url: http://domain.com/flash/flash.php -> mysql db -> http://domain.com/flash/flash.php -> flash movie.
so a user can make an account and paste links to his pictures, whitch then get showen in a flash movie. The user can then put that flash movie on his site with his own pictures in, but the flash movie is loaded from my server.
Please help!
A Little Flash/MySQL Help...
OK, I having trouble getting Flash MX to send text from an input field to a PHP.
In the Flash I have two input fields. One has the var name "price" and the other has var name "state".
I have a button with the following actions assigned to it...
on (release) {
loadVariablesNum("101.php", 0, "POST");
}
Then I have the following PHP...
<?php
include ('Include.inc');
$conn = mysql_connect($DBhost,$DBuser,$DBpass);
@mysql_select_db("$DBName");
$price = $_POST['price'];
$state = $_POST['state'];
$sql = "UPDATE $table SET price = '$price', state = '$state' WHERE unit = '103'";
if (mysql_query($sql, $conn)) {
echo "record added";
} else {
echo "wrong";
}
?>
It doesn't seem to be passing the info from Flash to the PHP. Any ideas would be greatly welcomed.
Thanks!
MySQL And Flash?
Hi I´m Genesis I work on a PHP based Multiplayer Game but I missing the action and thats why I want to make Shops and Fights with Flash but I dont know how to send and get Variables from a MySQL Database. Can Flash send and get Var. from a MySQL database?
Can Someone Help
Flash & Mysql
Hi, first of all excuse my bad english.
I want to know if it's easy to access a mysql database with flash, and pass variables between flash and php pages, I can't found any tutorial or manual.
Thanks.
Flash, PHP, MySQL
Has anyone ever had problems with a Flash app that loads vars from a PHP page that connects to a MySQL DB?
I made a "Now Playing" app for our station... basically, it accesses the PHP script that pulls the current song (title, artist, and seconds left) from the DB... spits it back to Flash. Flash then displays the info... waits for "seconds left" then goes back to frame 1 which hits the PHP page and starts all over again.
It works great... except when I made it live... within a few hours, there were so many connections to the DB it was using 99% of the CPU and basically made the site unviewable.
Figuring that I'd work on the timing issue later... I went back into Flash and killed the "loop" so that it just accessed the PHP script once per page request.
Problem is the exact same thing happened... 99% of CPU used.
PHP/MySQL is widely used on the site and I've never had this problem before. The server isn't a weak box either.
Has anyone else had this problem? I'm I missing something that's I sould have done? Or does Flash just not play well with PHP/MySQL?
I could do the same thing with flat files I guess... but I'd rather not start over from scratch.
Thanks.
Flash Php And Mysql
Hi all,
i already have a website which uses html, php and mysql and i'm trying to update it by making another version in flash. it's all going well so far but i'm now trying to do my links page.
i have my links stored in a mysql db with the linkname, linurl and linktype as the field for each row of the db. the php code i have for this at the minute is good for using with html but i'm reasonably new to flash and i'm having trouble getting my head round applying some of the php i already have (modified of course) to my flash site.
i can get the info from the db ok using loadVariablesNum and a php script requesting the info from the db as an array. what i am having problems with is how i should be bringing that info into flash. I've checked out a few tutorials and downloaded the files which come with them but am still a bit lost.
i am trying to apply a little bit of flash animation to each link so that it changes when the cursor moves over it. i have done this already with some internal flash links and it looks good. i would like each link from my db to be inserted into a new movie inside my links page. this would mean that i only have to create one version of the movie and it gets loaded once for each link in the db with the info for the link (linkname, linkurl) being inserted into a text field in that movie. As with my other internal flash movie links i would need a button mask for each link. i can't seem to figure out how to load a new version of the movie for each link, insert the relevant info for each link, creat and insert a button mask for each link and make sure that the links for the rollover, rollout, press and release works correctly in the button mask so that the relevant movie for each link is affected properly and when the link is clicked (press) it goes to the right website.
this may be easy for some of you to figure out, i'm not sure. i'm also not sure how well i'm explaining this, but any help people can give me would be greatly appreciated.
If anyone already uses php and mysql in a website to display links from a db, letting me have a look at their .fla files and php scripts would be even better help as i am quite good at figuring out code when i have it in front of me and would be able to apply it to my own circumstances as i need.
Cheers
John
MySQL In Flash
I need to select a variable from a MySQL DB. Everything is set. Can you provide an example of actionscript, for example, to make a textbox say something I could pull out of MySQL? I am familiar with MySQL context itself, I just need help doing it in Flash. ;_;
Thanks <3
Help Me.. Need A Little Help (Mysql, PHP And Flash)
Hey everyone. I Just followed an excellent tutorial on how to use the loadvars with php and Mysql. (check the tutorial at: http://webmonkey.wired.com/webmonkey...w=programming).
I have a php-file, that I searches through my Mysql-DB, and everything works fine. Flash shows a list of all the inserts (in the archives_txt) and when you click an entry, the main text will be shown in anoher textfield (entries_txt).
Everything works, except this: He hadn't thought of, that we ORDER BY DESC in php, so the latest entries will be at the first spot in my onload handler....
I have tried to rewrite the code a bit, and now it's working, except when I click the first link (the latest entry) - then it won't show. I now that this i because of flash starts is for loop at 0 and PHP starts the while loop at 1, but take a look at the code.. this shouldn't be a problem here???
Thanks anyway I'm drowning
Code attached
Flash, PHP & MySQL?
Hi All,
I have a project where I need to display dynamic text data that is stored in a mySQL database, in Flash.
In other words, I set up a web form in PHP to insert/update information into the database, and I need to pull this info out and display it in my SWF. So when a person uses my web form to update the text in the database, the text displayed in the SWF will change dynamically.
Any ideas?
PHP/MYSQL Flash
Hi,
I'm interested in using MYSQL/PHP with Flash.
I've scoured the web in search of info on how to go about this but most tutorials on the subject i've found so far assume your using a remote server and just inform you to setup tables using your PHPmyadmin etc.
As i'm wanting to just test things locally on my own machine, I was hoping someone could provide some insight on how I setup PHPmyadmin to control MYSQL.
I'm running OS/X with apache and have MYSQL server up and running according to my system pane but am not sure how to actually access it or how to setup phpmyadmin or cocoaMYSQL to do this so I can begin creating a database.
I'm not sure whether this is really the correct forum for this question but if anyone has any advice or knows where I can find some info on how to go about this I'd be really grateful.
Thanks
Mysql -> Flash
I have a table in mysql (date, header, body, and image, which is the name of an image file on the server).
I need flash to fetch this data and put it in the movieclip. But how..?!
Anyone good at this?
Flash And MySQL.
How do I connect a flash file to a MySQL database? as in send a query to it. My MySQL database is located on my computer.
Flash 8 / PHP / MySQL Help Please
Hi I'm trying to make a news viewing function in Flash 8. The swf calls out a php script, php script queries the MySQL DB then php sends info to swf file to display it. Unfortunately, the articles don't display and I keep getting "undefined" errors. I don't have this problem when I tested it on my PC but after upoading it to my host the problem arose.
this is the script i used in flash 8 to call out the PHP script:
function getData(ref) {
sectionContent = new LoadVars();
sectionContent.ignoreWhite = true;
sectionContent.onLoad = function(success) {
wait._visible = false;
if (success) {
pressHead.text = this.headline;
var newsPic = this.picture;
var picEmbed = '<img src='+'"'+'images/press/'+this.picture+'"'+' align="left">';
contentText.html = true;
contentText.htmlText = picEmbed+this.article;
calcSize();
gotoAndPlay(56);
}
};
sectionContent.load("jpg/media.php?row="+ref);
}
this is the script i used in php:
<?
$connect = mysql_connect("localhost", "admin", "password");
mysql_select_db("mydb", $connect);
$sql="SELECT * FROM tbl_press_release";
$result=mysql_query($sql);
$row=mysql_fetch_assoc($result);
if(isset($_GET[$row])){
mysql_query("SELECT * FROM tbl_press_release Where press_release=".$_GET[$row]."");
}
?>
<? echo "&headline=" . $row["headline"] . " &article=".$row['article']." &picture=" . $row['image'] . ?>
<?
} mysql_free_result($result);
mysql_close($connect);
?>
I hope someone can help me. Thanks!
MySQL->PHP->FLASH
I want to load 7 pictures out my database and display on a page and by pressing on the picture I wanted to display this picture and information from database to this picture such as ID, Telefon, color, weight...
For connection to database I should write somethig like this:
_________________________________________
<?
$username = "myusername";
$password = "mypassword";
//definition of 3 parameters,which we are going to use by connection
$host = "localhost";
//The name of the database that is to be selected
$database = "mydatabase";
$password = "password";
//Opening a connection to a MySQL Server with following username and password
$link = mysql_connect($host,$username,$password) or die("Error connecting to Database!" . mysql_error());
//selecting the database-bool
mysql_select_db($database) or die("Cannot select database!" . mysql_error());
$ID = $_GET["ID"];
$image = $_GET["image"];
$color = $_GET["color"];
//Close MySQL connection
mysql_close($link);
?>
___________________________
I am newbi in Actionscript and I don't know how to start so I would appreciate any help.
Should I do several holder_mc for every of 7 pictures and dynamic box for ID,Color...(how can i specify to which box to load?)
PHP / Mysql And Flash
Hi, trying to make a gallery of shows, with information and an poster (image). Need to store in mysql and display in flash. Would like one new movieClip instance for each entry. Have the two following scripts but need help to combine them or find another way. Help is extremely appriciated as I have been struggling for awhile.
My get info script (sort of works but doesn´t display the image) :
stop();
//starting variables
displayText = "";
a = 0;
textfield.text = "news:" + Totalnumber_of_entries ;
headerArray = new Array();
bodyArray = new Array();
published_dateArray = new Array();
imageArray = new Array();
image_descriptionArray = new Array();
urlArray = new Array();
url_descriptionArray = new Array();
while ( a < Totalnumber_of_entries ){
headerArray.push(eval( "header" + a ));
bodyArray.push( eval( "body" + a ));
published_dateArray.push( eval( "published_date" + a ));
imageArray.push( eval( "image" + a ));
image-descriptionArray.push( eval( "image_description" + a ));
urlArray.push( eval( "url" + a ));
url_descriptionArray.push( eval( "url_description" + a ));
//trace (visitorArray[a]);
a = a + 1;
}
/////////////////
//starting variables for the next while loop
//amount_to_show changes the amount of comments that are displayed. Change to whatever you want.
amount_to_show = 10;
b = 0;
c = amount_to_show;
/// function to refresh the comments in the textfield2
function refreshComments (){
while ( b < c ){
displayText = displayText + published_dateArray[b] + "<br><br>" + "<b>" + headerArray[b] + "</b><br><br>" + bodyArray[b] + "<br><br>"+ imageArray[b] + "<br><br>"+ image_descriptionArray[b] + "<br><br>"+ urlArray[b] + "<br><br>"+ url_descriptionArray[b] + "<br><br><br>";
b = b + 1;
if (b == Totalnumber_of_entries ){
b = c;
break
}
}
encoder(utf-8);
textfield2.htmlText = displayText;
}
refreshComments ();
Here is the attach new movieclip code:
//Array with all our information
memberInfo = [["Kirupa", "Flashing (MX) complete strangers in 32-bit color.", "http://www.kirupa.com/forum/member.php?u=1"], ["B.Rich", "Basketball, Golf, Web Media.", "http://www.kirupa.com/forum/member.php?u=4513"], ["Senocular", "Fun stuff, like Flash", "http://www.kirupa.com/forum/member.php?u=2867"]];
//Starting x & y values
var xPos = 150;
var yPos = 60;
//For loop to attach our container movieclip and pass the array information
for (i=0; i<memberInfo.length; i++) {
//attach the container clip
attachMovie("container", "new"+i, i, {_x:xPos, _y:yPos});
//increase the y postion each time
yPos += this["new"+i]._height+5;
//add the information
this["new"+i].name.text = memberInfo[i][0];
this["new"+i].interest.text = memberInfo[i][1];
this["new"+i].link = memberInfo[i][2];
}
Anyway to combine the function of these two?
Please hlp, B
|