Flash/php/mysql
Posted: Mon Dec 21, 2009 2:24 pm
I know this is a topic that has been beat to death in every php forum around the net. I've been looking all over for answers to this specific problem.
I am trying to do a lookup in a mysql DB using a partnumber and displaying the price in flash. here is my code:
I am using this template as a guide for communicating flash <> php
http://www.developphp.com/Flash_tutoria ... hp?tid=39
I keep getting "Resource id..." I am so close. Please help.
Thanks,
Jarrett
I am trying to do a lookup in a mysql DB using a partnumber and displaying the price in flash. here is my code:
Code: Select all
<?php
// Only run this script if the sendRequest is from our flash application
if ($_POST['sendRequest'] == "parse") {
// Access the value of the dynamic text field variable sent from flash
$uname = $_POST['uname'];
//*** hidden for security but connection has been established successfully
$link = mysql_connect("***","***","***") or die ("Could not connect to mysql because ".mysql_error());;
mysql_select_db("****");
$results = mysql_query("SELECT price FROM partno WHERE partnum = '$uname'");
$row = mysql_fetch_assoc($results);
// Print two vars back to flash, you can also use "echo" in place of print
print "var1=The name field with a variable of $uname has been sent to PHP and is back.";
print "&var2=$row";
}http://www.developphp.com/Flash_tutoria ... hp?tid=39
I keep getting "Resource id..." I am so close. Please help.
Thanks,
Jarrett