Flash Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsWeb DesignFlash Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 8th, 2004, 11:29 PM
olm75 olm75 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 26 olm75 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 38 m 12 sec
Reputation Power: 0
flash mx to PHP to flash mx

flash to php to flash
ok here's the problem im trying to get my flash mx search form to connect to my MySql database using PHP....example go to http://www.nightspotz.com and go to search link....does not do anything when the submit button is hit....does anyone have any sample .fla that has a search from flash on it will be greatly appreciated....

---------script attached to button:

on (release) {
myData = new LoadVars();
myData.venuename = venuename.text;
myData.state = state.getSelectedItem().label;
myData.city = city.getSelectedItem().label;
myData.areacode = areacode.text;
myData.venuetype = venuetype.getSelectedItem().label;
myData.agegroup = agegroup.getSelectedItem().label;
myData.musictype = musictype.getSelectedItem().label;

myData.sendAndLoad("search.php", myData, "POST");
gotoAndPlay(results);
venuename = "";
state = "";
city = "";
areacode = "";
venuetype = "";
agegroup = "";
musictype = "";
}


----------this is the PHP script:

<?

/* mysql connection*/
$username="nigolmvc_nigolmv";
$password="**********";
$database="nigolmvc_nightspotz";

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM venues WHERE `venuename` = '$venuename' AND 'areacode' = '$areacode'
AND 'city' = '$city' AND 'state' = '$state' AND 'clubtype' = '$clubtype' AND 'musictype' = '$musictype' AND 'agegroup' = '$crowd' ORDER BY `venuename` ASC", $colname_searchRS;
$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close();

$i=0;
while ($i < $num) {

$venuename=mysql_result($result,$i,"venuename");
$areacode=mysql_result($result,$i,"areacode");
$phone=mysql_result($result,$i,"phone");
$address=mysql_result($result,$i,"address");

echo "<b>$venuename</b><br>$address<br>$city<br>$state $zipcode<br>$areacode $phonenumber<br>$email<br>$website<br><br>$comments<br><hr><br>";

$i++;
}


-----here is the script from results .fla that should show results from PHP:

myData.load("search.php") //php line
myData.ref = this
//Fetch data
myData.onLoad = function(succes){
if(succes){
for(var i=0; i<this.cant; i++){
this.ref["venuename"+i].htmlText = "<b>"+this["venuename"+i]+"</b>"
this.ref["address"+i].text = this["address"+i]
this.ref["phonenumber"+i].text = this["phonenumber"+i]

}
} else trace("Error loading data")
}
stop()

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignFlash Development > flash mx to PHP to flash mx


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT