Jump to content

php to flash help :)


scottiescotsman

Recommended Posts

Hi I am new to PHP & SQL but have managed to have a functioning guestbook and download counter. At present they both work but I cant seem to code how to get the download counter to display on my flash movie clip. I have tried numerous different ways but as I am new I don't really know what I am doing lol. The SQL table [download_mamager] is formatted as follows .... id, FILE, DOWNLOADS but all I want to do is get the value of the DOWNLOADS column at the row I specify.

ie.

$data = mysqli_query("SELECT DOWNLOADS FROM downloads_manager WHERE id = 'xx'");

 

and view the result on a flash textfield.

 

hope someone can help

 

 

cant seem to figure out how to add my as3 code here :(

update.php

Link to comment
https://forums.phpfreaks.com/topic/286649-php-to-flash-help/
Share on other sites

mysqli_query returns a result set. To get out of the result set you need to use one of the mysqli_fetch_* functions

$result = mysqli_query("SELECT DOWNLOADS FROM download_manager WHERE id = 'xx'"); // query returns a resultset
$data = mysqli_fetch_assoc($result); // get the data from the resultset
$body = '<b><font name="Teen" color="#009999" size="11">' . $data['DOWNLOADS'] . '</font></b> ';
Link to comment
https://forums.phpfreaks.com/topic/286649-php-to-flash-help/#findComment-1471258
Share on other sites

<?php

error_reporting(E_ALL^E_NOTICE);

require('connect.php');

$body="";

$result = mysqli_query("SELECT * FROM download_manager WHERE id = 'xx'");

$data = mysqli_fetch_assoc($result);

$result->close();

$body = '<b><font name="Teen" color="#009999" size="11">' . $data['DOWNLOADS'] . '</font></b> ';

echo "returnBody=$body";

exit();

?>

 

 

hope that's right

Link to comment
https://forums.phpfreaks.com/topic/286649-php-to-flash-help/#findComment-1471268
Share on other sites

  • 2 weeks later...

<?php

require_once ('connect.php');

$id = $_GET['xx'];

$body = "";

if ($id == 0)

{

$body = '<b><font color="#009999" size="11">NO DATA</font></b>';

}

else

{

$result = mysql_query("SELECT * FROM download_manager WHERE id = $id");

$row = mysql_fetch_assoc($result);

$body = '<b><font name="Teen" color="#009999" size="13" align="left">'.$row['DOWNLOADS'].'</font></b>';

}

echo "returnBody=$body";

exit();

?>

 

All fixed now :)

Link to comment
https://forums.phpfreaks.com/topic/286649-php-to-flash-help/#findComment-1472661
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.