almost got it need a little help

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   almost got it need a little help
olm75
CZ Newbie
olm75 has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Dec 05, 2004
0.00 posts per day
Posts: 10
Points: 621
   
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
[ Register or login to view links on this board.] 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:\n";
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.";
}
}



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