Welcome, Guest
  • Author Topic: Using Where  (Read 913 times)

    macromotion

    • Server what's that
    • *
    • Posts: 43
      • View Profile
      • Email
    Using Where
    « on: 10/09/05, 19:43 »
    Hi all. I use the interaction with PHP, and i have some problem. How i can use the statement between, with the fields in Flash?
    He create the xml perfect, but in the values (09/10/2005 and 10/10/2005) i need the fields of Flash.
    My code is.
    Code: [Select]
    <?php
    //Include database variables
    include_once("inc_sql.php");
    //Connect to database
    $connect mysql_connect(HOSTNAMEUSERNAMEPASSWORD);
    mysql_select_db(DATABASE$connect);
    //Query the database
    $result mysql_query("select * from ag_expedicao where emissao between '09/10/2005' and '10/10/2005'");
    //And now we need to output an XML document
    //We use the names of columns as <row> propertys
    echo <?xml version="1.0" encoding="UTF-8"?>
    ';
    echo '<datapacket>';
    while($row=mysql_fetch_array($result)){
    $line = '<row Id="'.$row[Id].'" fatura="'.$row[fatura].'" emissao="'.$row[emissao].'" pedido="'.$row[pedido].'" ean="'.$row[ean].'" produto="'.$row[produto].'" qtd="'.$row[qtd].'" datas="'.$row[datas].'" uf="'.$row[uf].'"/>';
    echo $line;
    }
    echo '</datapacket>';
    ?>

    Tanks.

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Using Where
    « Reply #1 on: 10/10/05, 03:43 »
    To give format to a date field, see mysql DATE_FORMAT function: http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html

    Jorge

    macromotion

    • Server what's that
    • *
    • Posts: 43
      • View Profile
      • Email
    Re: Using Where
    « Reply #2 on: 10/11/05, 19:44 »
    Hi. I know this. Bui how i can link the fields of between, value 1 and 2, with fields in FLASH. Understand?

    macromotion

    • Server what's that
    • *
    • Posts: 43
      • View Profile
      • Email
    Re: Using Where
    « Reply #3 on: 10/11/05, 19:46 »
    I need to send the request to php and receive the results.

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Using Where
    « Reply #4 on: 10/12/05, 03:23 »
    Check http://www.flash-db.com/Tutorials/loading/ and http://www.flash-db.com/Tutorials/saving/ to know how to pass, receive data from a back-end script using LoadVars

    Jorge