SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist spoondevil's Avatar
    Join Date
    Jun 2001
    Location
    Harlow, Essex, UK
    Posts
    426
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Database Connection & Extraction

    At the moment, I am just trying to extract info from a MySQL database through Flash via a PHP script. The script is:
    PHP Code:
    <?php
    include ('include.inc');
    mysql_connect($DBhost,$DBuser,$DBpass);
    @
    mysql_select_db("$DBName");
    $query "SELECT value FROM content WHERE field = 'FrontPageNews'";
    $result mysql_query($query);
    $value mysql_result($result,0,"value");
    print 
    "&value=$value";
    ?>
    I have a multiline dynamic text box with a variable name of "value" and the following actionscript:
    Code:
    loadVariablesNum("php/read.php", 0, "POST");
    stop();
    But it is not extracting the info. It connects to the database fine, as I used it from a tutorial on FlashKit. The script works in phpMyAdmin, just not in Flash.

    It does, however, work when I use the following PHP script, but it's not extracting the info from a database though:
    PHP Code:
    <?php
    include ('include.inc');
    mysql_connect($DBhost,$DBuser,$DBpass);
    @
    mysql_select_db("$DBName");
    $query "SELECT value FROM content WHERE field = 'FrontPageNews'";
    $result mysql_query($query);
    $value mysql_result($result,0,"value");
    $test_msg "hello"
    $test "&value=$test_msg"
    print 
    "$test"
    ?>
    The page is at http://test.bigworms.com


    Any Ideas?

  2. #2
    SitePoint Zealot
    Join Date
    Apr 2003
    Posts
    181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When you test in Flash, open up the variables window and have a look - do you see anything that's come back from the server?

    If you're sure the PHP script is fine, then chances are that there is a character in the returned $value variable that is preventing the display of the text in Flash: &apos; for example.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •