# "Learn How to Use Flash with PHP and mySQL" - Stuck! Please help!

**URL:** <https://forum.kirupa.com/t/learn-how-to-use-flash-with-php-and-mysql-stuck-please-help/165844>\
**Category:** Uncategorized\
**Created:** [October 14, 2005, 9:12am UTC](https://forum.kirupa.com/t/learn-how-to-use-flash-with-php-and-mysql-stuck-please-help/165844 "2005-10-14T09:12:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fuggedaboutit](https://avatars.discourse-cdn.com/v4/letter/f/779978/32.png) [@fuggedaboutit](https://forum.kirupa.com/u/fuggedaboutit)\
**Post date:** [October 14, 2005, 9:12am UTC](https://forum.kirupa.com/t/learn-how-to-use-flash-with-php-and-mysql-stuck-please-help/165844/1 "2005-10-14T09:12:41Z")

</div>

I’m trying to link a MySQL database via php to my flash movie, whcih should display a list of pubs. I have a movie clip (which just consists of a dynamic text box with variable name ‘house’) which has these actions attached to it:  
onClipEvent (load) {  
type=“Pub”;  
loadVariables(“[http://localhost/read.php](http://localhost/read.php)”, this, “POST”);  
}

My PHP file is called ‘read.php’ and has the following code (i’ve replaced the username/password with ???):

\<?php  
$type = $\_POST[“type”];  
$dbhost = “localhost”;  
$dbname = “eldridge”;  
$dbuname = “???”;  
$dbpass = “???”;  
mysql\_connect($dbhost, $dbuname, $dbpass);  
@mysql\_select\_db($dbname);  
$connect = @mysql\_connect($dbhost, $dbuname, $dbpass);  
if (!$connect){  
echo “&house=Server Error&”;  
exit;  
}  
if (!@mysql\_select\_db($dbname)){  
echo"&house=Database Error&";  
exit;  
}  
$result = @mysql\_query(“SELECT `house` FROM `houses` WHERE `type`=’$type’”);  
if ($result && @mysql\_num\_rows($result) \> 0){

while($row = mysql\_fetch\_array($result)){  
$homes = $row[‘house’];  
$return .= ‘’ . $homes . ‘\<br\>’;  
}  
print"&house=$return&";  
}else{  
print"&house=No Results&";  
}  
mysql\_close($connect);  
?\>

This doesn’t seem to work at all and i’m getting no results at all, could anyone suggest what i’ve done wrong or what i could do to try and fix it?

Thanks in advance for any help
