4.3.11 vs 4.4.4
Moderator: General Moderators
4.3.11 vs 4.4.4
Hi all .. i'm a newbie ...
I have a simple PHP script that works in 4.3.11 but not in 4.4.4
It's a script that receives variables from a Flash movie and passes them on to MySQL.
Does anyone know if there are any big differences between the 2 versions that I need to be aware of?
Thanks!
I have a simple PHP script that works in 4.3.11 but not in 4.4.4
It's a script that receives variables from a Flash movie and passes them on to MySQL.
Does anyone know if there are any big differences between the 2 versions that I need to be aware of?
Thanks!
- Gente
- Forum Contributor
- Posts: 252
- Joined: Wed Jun 13, 2007 9:43 am
- Location: Ukraine, Kharkov
- Contact:
Re: 4.3.11 vs 4.4.4
php.net knows. Check herejimster wrote:Does anyone know if there are any big differences between the 2 versions that I need to be aware of?
You can clear all unnecessary and put your code.jimster wrote:It's a script that receives variables from a Flash movie and passes them on to MySQL.
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Thanks! I had looked at that page from phpnet before, in particular the changelog for 4.4, but found nothing that could be causing the problem.
Here's what the code looks like. I think it's the BuildQuery portion that's causing me grief. Any suggestions at all will be appreciated!Code: Select all
<?php
// Define database connection details
$dbHost = "xxx";
$dbUser = "xxx";
$dbPass = "xxx";
$dbName = "xxx";
// Attempt to connect to MySQL server
$link = @mysql_connect($dbHost, $dbUser, $dbPass);
// If the connection was unsuccessful...
if (!$link)
{
// Report error to Flash and exit
print "&result=Fail";
print "&errorMsg=" . urlencode("Could not connect to server");
exit;
}
// Attempt to connect to MySQL server
$link = @mysql_connect($dbHost, $dbUser, $dbPass);
// If the connection was unsuccessful...
if (!$link)
{
// Report error to Flash and exit
print "&result=Fail";
print "&errorMsg=" . urlencode("Could not connect to database");
exit;
}
// Attempt to select database. If unsuccessfull...
if (!@mysql_select_db($dbName))
{
// Report error to Flash and exit
print "&result=Fail";
print "&errorMsg=" . urlencode("Could not select $dbName database");
exit;
}
// Build Query
$query = "INSERT INTO petition (username, continent, country, email)
VALUES('$userName', '$userContinent', '$userCountry', '$userEmail')";
// Execute Query
$result = @mysql_query($query);
if($userContinent=="Asia"){
// Build Asia Query
$cont1_query = "INSERT INTO petition_as (username, country, email)
VALUES('$userName', '$userCountry', '$userEmail')";
// Execute Query
$result = @mysql_query($cont1_query);
}
if($userContinent=="Australia"){
// Build Australia Query
$cont2_query = "INSERT INTO petition_oz (username, country, email)
VALUES('$userName', '$userCountry', '$userEmail')";
// Execute Query
$result = @mysql_query($cont2_query);
}
if($userContinent=="Africa"){
// Build Africa Query
$cont3_query = "INSERT INTO petition_af (username, country, email)
VALUES('$userName', '$userCountry', '$userEmail')";
// Execute Query
$result = @mysql_query($cont3_query);
}
if($userContinent=="Europe"){
// Build Europe Query
$cont4_query = "INSERT INTO petition_uk (username, country, email)
VALUES('$userName', '$userCountry', '$userEmail')";
// Execute Query
$result = @mysql_query($cont4_query);
}
if($userContinent=="North America"){
// Build North America Query
$cont5_query = "INSERT INTO petition_na (username, country, email)
VALUES('$userName', '$userCountry', '$userEmail')";
// Execute Query
$result = @mysql_query($cont5_query);
}
if($userContinent=="South America"){
// Build South America Query
$cont6_query = "INSERT INTO petition_sa (username, country, email)
VALUES('$userName', '$userCountry', '$userEmail')";
// Execute Query
$result = @mysql_query($cont6_query);
}
// If query was successful
if ($result)
{
// Report success back to Flash movie
print "&result=Okay";
}
else
{
// Otherwise, tell Flash we stuffed up
print "&result=Fail";
print "&errorMsg=" . urlencode("Failed to submit petition, please try again later.");
}
// Close the connection
mysql_close($link);
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
Alright. The first thing to do is make sure that the $_POST variable is filled with values. Read up on what the $_POST superglobal is, then show me you assigning the local variables from this array.