# Almost got it need a little help....please

**URL:** <https://forum.kirupa.com/t/almost-got-it-need-a-little-help-please/73588>\
**Category:** Uncategorized\
**Created:** [December 17, 2004, 11:14pm UTC](https://forum.kirupa.com/t/almost-got-it-need-a-little-help-please/73588 "2004-12-17T23:14:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![olm75](https://avatars.discourse-cdn.com/v4/letter/o/8c91f0/32.png) [@olm75](https://forum.kirupa.com/u/olm75)\
**Post date:** [December 17, 2004, 11:14pm UTC](https://forum.kirupa.com/t/almost-got-it-need-a-little-help-please/73588/1 "2004-12-17T23:14:16Z")

</div>

for some reason i cant get the info to go to flash mx i was told i should send it as a string…here is the PHP and AS, u can also look at my site  
[http://www.nigtspotz.com](http://www.nigtspotz.com) and go to the search link…  
-----ok here is my PHP SELECT script-----

\<?php  
mysql\_connect(“localhost”,“_ **","** _\*\*\*”);  
mysql\_select\_db(“nigolmvc\_nightspotz”);

$$areaCode = $\_POST[‘areacode’];  
$qr = mysql\_query(“SELECT \* FROM venues WHERE areacode = ‘$areaCode’ ORDER BY venuename ASC”);

// start output string with number of entries  
$nrows = mysql\_num\_rows($qr);  
$rString = “&n=”.$nrows;

for ($i=0; $i \< $nrows; $i++) {  
$row = mysql\_fetch\_array($qr);  
$rString .= “&venueName”.$i."=".$row[‘venueName’]."&address".$i."=".$row[‘address’];  
$rString .= “&city”.$i."=".$row[‘city’]."&state".$i."=".$row[‘state’];  
$rString .= “&areaCode”.$i."=".$row[‘areaCode’]."&phoneNumber".$i."=".$row[‘phoneNumber’];  
}  
echo $rString."&";  
?\>

------here’s the AS------i’m also trying to make each variable go to its own column…when formating in flash mx…

/\* this starts the script to send and load to PHP

submitURL = “[http://localhost/search.php](http://localhost/search.php)”;

function onSubmit() {  
//Movieclip GotoAndPlay Behavior  
this.gotoAndPlay(“result”);  
//End Behavior  
// Create a new LoadVars instance for the form data  
formData = new LoadVars();  
// Initialize formData variables:  
formData.venueName = “”;  
formData.state = “”;  
formData.city = “”;  
formData.areaCode = “”;  
formData.venueType = “”;  
formData.ageGroup = “”;

// Gather the order information into a LoadVars instance.  
formData.venueName = venueName\_txt;  
formData.state = state\_cb.getValue();  
formData.state = city\_cb.getValue();  
formData.areaCode = areaCode\_txt;  
formData.venueType = venueType\_cb.getValue();  
formData.ageGroup = ageGroup\_cb.getValue();

// Create another LoadVars instance to receive the server’s reply  
replyData = new LoadVars();  
// Initialize reply variable.  
replyData.reply\_venueName = “”;  
replyData.reply\_address = “”;  
replyData.reply\_city = “”;  
replyData.reply\_state = “”;  
replyData.reply\_zipCode = “”;  
replyData.reply\_areaCode = “”;  
replyData.reply\_phoneNumber = “”;

// Specify a function to call when this new instance receives the reply.  
replyData.onLoad = handleReply;  
// Submit the order data  
formData.sendAndLoad(submitURL, replyData, “post”);  
// Tell the user what’s happening.  
message\_txt.text = “Submitting search, please wait…”;  
}  
function handleReply(success) {  
if (success) {  
message\_txt.text = "Your search was received:  
";  
message\_txt.text += "Venue Name: " + replyData.reply\_venueName + newline;  
message\_txt.text += "Address: " + replyData.reply\_address + newline;  
message\_txt.text += "City: " + replyData.reply\_city + newline;  
message\_txt.text += "State: " + replyData.reply\_state + newline;  
message\_txt.text += "Zipcode: " + replyData.reply\_zipCode + newline;  
message\_txt.text += "Areacode: " + replyData.reply\_areaCode;  
message\_txt.text += "Phone: " + replyData.reply\_phoneNumber;

} else {  
message\_txt.text = “There was a problem submitting your search. The server may be down or not responding.”;  
}  
}
