i'm passing two parameters(strings) in from flash and i want to pass those along into the sql query in my php page.
new to php so I'm sure i'm doing something incorrectly with the variable asignment and in the sql.
the rest of the php code i have works great. i changed my query to incorporate these variables (i thought anyway) and of course it doesn't work!
i get this xml back (with accompanying error)
<?xml version="1.0" encoding="UTF-8"?><datapacket><br />
<b>Warning</b>: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in <b>/home/virtual/site370/fst/var/www/html/products/flashDIr/getDetails.php</b> on line <b>16</b><br />
</datapacket>
any help is greatly appreciated!
here's my php:
<?php
//this line includes the database connection variables
include_once("config.php");
//set vars from flash
$first = $first;
$last = $last;
$result = mysql_query("SELECT * FROM members WHERE last=$last AND first=$first ORDER BY last");
// And now we need to output an XML document
// We use the names of columns as <row> properties.
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo '<datapacket>';
while($row=mysql_fetch_array($result)){
$line = '<member last="'.$row[last].'" first="'.$row[first].'" user="'.$row[user].'" pass="'.$row[pass].'" address1="'.$row[address1].'" address2="'.$row[address2].'" city="'.$row[city].'" state="'.$row[state].'" zip="'.$row[zip].'" home="'.$row[home].'" work="'.$row[work].'" fax="'.$row[fax].'" email="'.$row[email].'" photo="'.$row[photo].'"/>';
echo $line;
}
echo '</datapacket>';
?>