Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

Results 1 to 3 of 3

Thread: Am I even close? (php, mySql)

  1. #1

    [Flash PHP] Am I even close?

    Iíve tried to work with the many tutorials out there but Iím still lost. My php seems to be working (connects to mySql) but I cant to get my query into flash. My fla has a movie clip that contains a text field with the variable name myText. Am I even close to getting this to work? Grateful for any input.

    PHP Code:
    <?php
    // Connect and select.
    if ($dbc = @mysql_connect ('localhost''username''password')) {
     
    if (!@
    mysql_select_db ('myblog')) {
    die (
    '<p>Could not select the database because: <b>' mysql_error() . '</b></p>');
    }
    } else {
    die (
    '<p>Could not connect to MySQL because: <b>' mysql_error() . '</b></p>');
    }
     
    // Define the query.
    $query 'SELECT * FROM blog_entries ORDER BY date_entered DESC';
     
    if (
    $r mysql_query ($query)) { // Run the query.
    // Retrieve and print every record.
    while ($row mysql_fetch_array ($r)) {
    print 
    "<p>{$row['date_entered']}<br />
    <b>
    {$row['title']}</b><br />
    {$row['entry']}<br /></p>\n";
    }
    } else { 
    // Query didn't run.
    die ('<p>Could not retrieve the data because: <b>' mysql_error() . "</b>. The query was $query.</p>");
    // End of query IF.
    mysql_close(); // Close the database connection.
    ?>
    Code:
     
    onClipEvent (load) {
    loadVariables("http://localhost/blog.php?", this, "GET");
    }

  2. #2
    jw06's Avatar
    657
    posts
    Registered User
    what kind of errors is it giving you?

  3. #3
    I'm getting this in the output window.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012