# Am I even close? (php, mySql)

**URL:** <https://forum.kirupa.com/t/am-i-even-close-php-mysql/138322>\
**Category:** Uncategorized\
**Created:** [February 21, 2005, 9:43pm UTC](https://forum.kirupa.com/t/am-i-even-close-php-mysql/138322 "2005-02-21T21:43:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![machine](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@machine](https://forum.kirupa.com/u/machine)\
**Post date:** [February 21, 2005, 9:43pm UTC](https://forum.kirupa.com/t/am-i-even-close-php-mysql/138322/1 "2005-02-21T21:43:32Z")

</div>

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
 
<?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>
";
}
} 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.
?>

```

```auto
 
onClipEvent (load) {
loadVariables("[http://localhost/blog.php](http://localhost/blog.php)?", this, "GET");
}

```
