I have the following php code:
This picks up the values in the db and sends to flash. The output looks like mclocation=5,8426,NULLPHP Code:<?php
// connect to the database
.....removed.....
$query = "SELECT id FROM takensquares WHERE id BETWEEN 1 AND 10000 AND taken = 1";
$result = mysql_query($query) or die(mysql_error());
// count rows of array
$num = mysql_numrows($result);
echo "mclocation=";
// output array results separated by commas
$i=0;
while ($i < $num) {
$id=mysql_result($result,$i,"id");
echo $id,",";
$i++;
// print "status=Connection successful...&checklog=5";
}
echo "null";
?>
No probs but I want to change the query line to:
Now I use POST to get "$from" and "$to" from the flash file. Only problem is that this doesn't seem to work. So I tried:PHP Code:$query = "SELECT id FROM takensquares WHERE id BETWEEN '$from' AND '$to' AND taken = 1";
and put the variables in to the url and it worked fine (I got mclocation=5,8426,NULL again). How come GET works and POST doesn't? I've checked the vars in flash by putting in 2 dynamic text boxes and I get 1 and 10000 respectively but they are either not going in to the php query or something else I don't know about is happening.PHP Code:$from = $_GET ['from'];
$to = $_GET ['to'];
Just can't get my head around thisAny ideas?




Any ideas?
Reply With Quote