In the How do I FAQ, section AJAX :
How do I pull variables out of a PHP page using AJAX ? - LINK
In the tutorials:
AJAX example with Construct2; Online High Score Table (AJAX, PHP, MySQL).
thask for the reply, I follow this example but doesn't work, I didn't understand the logic...
now is working, but if I use the:
<?php
header('Access-Control-Allow-Origin: *');
require 'gold.php';
echo $gold;
?>
the variable in construct 2 will be "NaN"
gold.php is this:
<?php
header('Access-Control-Allow-Origin: *');
require 'facebook_login.php';
///////////////////
? if ( $loadspecific == "caricadati" ) {
$query = "SELECT goldDB FROM tabletest WHERE UIDfacebook = $id";
$result2 = mysql_query(mysql_real_escape_string($query)) or die (mysql_error());
while($row = mysql_fetch_array($result2))
{
?//echo "\\";
?$gold = "{$row['goldDB']}" ;
?//echo $gold;
?
?//echo $_GET['gold'];
}
}else{
//echo $result;
}
?>
I start to make a project with facebook... now my project save the data from facebook API in my database and load the single information in the database (gold.php)
now my problem is load the variable in Construct2 because in php is working
i'm thinking if the problem is "while($row = mysql_fetch_array" but the echo will be a single number like "1111", but Construct2 doesn't load the variable if I insert require 'facebook_login.php'; <img src="smileys/smiley19.gif" border="0" align="middle">
the variable is from my database...