Hi,
With some help I’ve almost solved the updating problem
MAINTIMELINE Frame 1:
this.regForm_mc.onData=function(){
//DATA FINISHED LOADING.
//LET'S DISPLAY IT!
this.play();
}
INSIDE regForm_mc frame (1)
// Don't play movie clip initially
stop();
//
function valForm() {
//Form Validation
// Make sure the user filled in all the required fields.
if (!name_txt.text.length || name_txt.text == " ") {
status_txt.text = "All fields are required";
} else if (!email_txt.text.length || email_txt.text == " ") {
status_txt.text = "All fields are required";
} else if (!location_txt.text.length || location_txt.text == " ") {
status_txt.text = "All fields are required";
} else {
status_txt.text = "";
//Define TextFields
//Name = name_txt.text;
//Email = email_txt.text;
//Location = location_txt.text;
// loadVars object
// loads specific variables and sends them
myVars = new LoadVars();
myVars.name = name_txt.text;
myVars.email = Email_txt.text;
myVars.list = list_txt.text;
myVars.location = location_txt.text;
trace(myVars.toString());
//
myVars.sendAndLoad("register.php", myVars, "POST");
//
//
// Display the loading frame while data loads.
gotoAndStop("Loading");
}
}
submit_btn.onRelease = valForm;
<?
/* MySQL details */
$dbHost = "localhost"; /*omitted for post*/
$dbUser = "blah_blah"; /*omitted for post*/
$dbPass = "blah_blah"; /*omitted for post*/
$dbName = "blah_blah"; /*omitted for post*/
$table = "downloadLog";
/* Attempt connection to MySQL server */
$link = @mysql_connect($dbHost, $dbUser, $dbPass);
/* If connection wasn't successful... */
if (!$link) {
/* Return error information to Flash and quit! */
print "&list=" . urlencode("<b>Error:</b> Could not conenct to database") . "&";
exit;
}
/* Attempt to select our database */
/* If not able to select... */
if (!@mysql_select_db($dbName)) {
/* Return error information to Flash and quit! */
print "&list=" . urlencode("<b>Error:</b> Could not find $dbName database") . "&";
exit;
}
/* Fetch current time from server */
$currentTime = time();
/* Build SQL query to insert our information into table */
$query = "INSERT INTO $table (name, email, location, entryDate) ";
$query .= "VALUES('$name', '$email', '$location', $currentTime)";
/* Execute query */
$result = mysql_query($query);
/* If there was an error executing query... */
if (!$result) {
/* Return error information to Flash and quit! */
print "&list=" . urlencode("Error: Could not insert record into download log") . "&";
exit;
}
/* Build SQL query to fetch all entries from the table */
$query = "SELECT * FROM $table ORDER BY entryDate DESC";
/* Execute query */
$result = mysql_query($query);
/* If there was a problem with the query... */
if (!$result || @mysql_num_rows($result) < 1) {
/* Return error information to Flash and quit! */
print "&list=" . urlencode("No entries in table $table") . "&";
exit;
}
/* Reset variable to hold output */
$list = "";
/* For each table entry returned... */
while($row = mysql_fetch_array($result)) {
/* Create human readable date from timestamp */
$entryDate = strftime("%A %d/%m/%y", $row['entryDate']);
/* Add details to output variable */
$list .= "<b>Date:</b> " . $entryDate . "<br>";
$list .= "<b>Name:</b> " . $row['name'] . "<br>";
$list .= "<b>Email:</b> " . $row['email'] . "<br>";
$list .= "<b>Location:</b> " . $row['location'] . "<br><br>";
}
/* Output data in required format */
print "&list=" . urlencode($list) . "&";
/* Close link to MySQL */
mysql_close($link);
?>
At registration
The data is not loaded, the application now hangs on the loading screen.
Would someone assist?