Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Flash/MySQL

Flash/MySQL
Thread Tools
Grizzled Veteran
Join Date: Aug 2002
Status: Offline
Reply With Quote
Feb 3, 2005, 11:29 AM
 
OK, lets see if I can explain this correctly.

I have a move clip called 101.
I have...
onClipEvent (load) {
loadVariables("you.php", this, "GET");
}
assigned to 101. Inside of 101 I have dynamic text fields with the var names of price, fee, and state.

I have a movieclip 102 that is exactly like 101. What I need to know is, how can differentiate 101 from 102 so that when the db data comes in that 101 and 102 display different info?

Also, I can't change the var names. They must stay as price, fee, and state in both movieclips.

Please give me a hand with this, it is very urgent. If you need more info please ask. Thanks!
     
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Feb 3, 2005, 03:29 PM
 
Originally posted by MallyMal:
OK, lets see if I can explain this correctly.

I have a move clip called 101.
I have...
onClipEvent (load) {
loadVariables("you.php", this, "GET");
}
assigned to 101. Inside of 101 I have dynamic text fields with the var names of price, fee, and state.

I have a movieclip 102 that is exactly like 101. What I need to know is, how can differentiate 101 from 102 so that when the db data comes in that 101 and 102 display different info?

Also, I can't change the var names. They must stay as price, fee, and state in both movieclips.

Please give me a hand with this, it is very urgent. If you need more info please ask. Thanks!
onClipEvent (load) {
loadVariables("you.php?id="+this._name, this, "GET");
}

This assumes of course that your instance name is 101, 102, etc...

Now your php script can access the GET variable 'id' and retrieve the correct data from the database.
Computer thez nohhh...
     
Grizzled Veteran
Join Date: Aug 2002
Status: Offline
Reply With Quote
Feb 3, 2005, 03:35 PM
 
My PHP looks like this is this right?

<?php

$conn = mysql_connect("localhost", "root", "");
mysql_select_db("loft588", $conn);

$sql = "SELECT * FROM units";

$result = mysql_query($sql, $conn);

while ($newArray = mysql_fetch_array($result)) {

$id = $newArray['id'];
$unit = $newArray['unit'];
$floor = $newArray['floor'];
$price = $newArray['price'];
$sqft = $newArray['sqft'];
$fee = $newArray['fee'];
$state = $newArray['state'];

echo ("&id=$id&unit=$unit&floor=$floor& price=$price&sqft=$sqft&fee=$fee&state =$state");

}

?>
     
Grizzled Veteran
Join Date: Aug 2002
Status: Offline
Reply With Quote
Feb 3, 2005, 03:38 PM
 
Is there anyway I can IM you? I have battling with this for days.

Also, in my case what should +this._name be?
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:08 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2