flash mx to PHP to flash mx

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   flash mx to PHP to flash mx
olm75
CZ Newbie
olm75 has been a member for over 19 year's 19 Year Member
Status: Offline
Joined: Dec 05, 2004
0.00 posts per day
Posts: 10
Points: 621
   
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 [ Register or login to view links on this board. ] 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 "$venuename<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 = ""+this["venuename"+i]+""
this.ref["address"+i].text = this["address"+i]
this.ref["phonenumber"+i].text = this["phonenumber"+i]

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



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum