A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Php, help me please

  1. #1

    Php, help me please

    I need to create a php script that writes a variable to a txt file, how would this be done? can someone give me code examples, im new at php... thanks for help in advance!

  2. #2
    Senior Member
    Join Date
    Jul 2002
    Posts
    175
    set the loadvars to the php code and have your php print out variablers:

    PHP Code:
    <?
    //written by Carlos Aguilar
    //connecting my ***** ass
    $host= "localhost";
    $username= "oz52com3";
    $password= "********";
    $database= "52oz_com";

    mysql_connect($host, $username, $password);
    mysql_select_db("$database");

    $result=mysql_query("SELECT * FROM work ORDER BY date DESC LIMIT 0, 5");
    $i=0;
    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
        $disp="var$i=".$row[name]."";
        if($i<4){
            $disp.="&";
        }
        echo $disp;
        $i++;
    }
    ?>
    I actually have a quick question though; should the variables be in quotes or not. Eg, should you do this
    PHP Code:
    var0 "hello world"
    or
    PHP Code:
    var0 =hello world

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center