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 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”;
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.”;
}
}