makoinater Posted March 10, 2008 Share Posted March 10, 2008 Im using PHP to Query My Database for the entry in the field 'rss' in the user table with the 'user_id' as $user_id. Now Iv been successful in using PHP with actionscript to put in variables into my database and to bring vars back. But when I should be getting a value that looks like httP://.....xml It brings me back something like 'Resouce id #3' heres the code I have - <?php $user_id = $_POST['username']; $link = mysql_connect("xxxx", "xxxx","xxxx") or die ("Unable to connect to database."); mysql_select_db("markfar_user") or die ("Unable to select database."); $sql= "SELECT rss FROM users WHERE user_id = '$user_id'"; $result = mysql_query($sql, $link); print "&res= $result"; mysql_close(); ?> Any Help? cheers Quote Link to comment Share on other sites More sharing options...
trq Posted March 10, 2008 Share Posted March 10, 2008 <?php if (isset($_POST['username'])) { $user_id = $_POST['username']; $link = mysql_connect("xxxx", "xxxx","xxxx") or die ("Unable to connect to database."); mysql_select_db("markfar_user") or die ("Unable to select database."); $sql= "SELECT rss FROM users WHERE user_id = '$user_id'"; if ($result = mysql_query($sql, $link)) { if (mysql_num_rows($result)) { $row = mysql_fetch_assoc($result); print "&res={$row['rss']}"; } } mysql_close(); } ?> Quote Link to comment Share on other sites More sharing options...
makoinater Posted March 10, 2008 Author Share Posted March 10, 2008 Yes thank you very much that worked perfectly And unbelievably quick aswell! 3minutes no less Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.