Imtehbegginer Posted February 17, 2007 Share Posted February 17, 2007 Wierd... My code: $str = mysql_query("SELECT str FROM characters WHERE char_name = '".$_POST['char_name']."'"); $dex = mysql_query("SELECT dex FROM characters WHERE char_name = '".$_POST['char_name']."'"); $con = mysql_query("SELECT con FROM characters WHERE char_name = '".$_POST['char_name']."'"); $int = mysql_query("SELECT _int FROM characters WHERE char_name = '".$_POST['char_name']."'"); $lvl = mysql_query("SELECT level FROM characters WHERE char_name = '".$_POST['char_name']."'"); The str in the characters table = 15, but when I do: <?php echo $str ; ?> I get "Resource #7" any ideas? Link to comment https://forums.phpfreaks.com/topic/38944-mysql-query/ Share on other sites More sharing options...
sspoke Posted February 17, 2007 Share Posted February 17, 2007 query is not the result query = pointer Link to comment https://forums.phpfreaks.com/topic/38944-mysql-query/#findComment-187328 Share on other sites More sharing options...
fert Posted February 17, 2007 Share Posted February 17, 2007 http://us2.php.net/manual/en/function.mysql-fetch-array.php Link to comment https://forums.phpfreaks.com/topic/38944-mysql-query/#findComment-187330 Share on other sites More sharing options...
sspoke Posted February 17, 2007 Share Posted February 17, 2007 $str = mysql_query("SELECT str FROM characters WHERE char_name = '".$_POST['char_name']."'"); $dex = mysql_query("SELECT dex FROM characters WHERE char_name = '".$_POST['char_name']."'"); $con = mysql_query("SELECT con FROM characters WHERE char_name = '".$_POST['char_name']."'"); $int = mysql_query("SELECT _int FROM characters WHERE char_name = '".$_POST['char_name']."'"); $lvl = mysql_query("SELECT level FROM characters WHERE char_name = '".$_POST['char_name']."'"); would be like $ptr = mysql_query("SELECT * FROM characters WHERE char_name = '".$_POST['char_name']."'"); like loop for $chardata = mysql_fetch_array($ptr) $str = $chardata['str'] $dex = $chardata['dex'] $con = $chardata['con'] Link to comment https://forums.phpfreaks.com/topic/38944-mysql-query/#findComment-187335 Share on other sites More sharing options...
Imtehbegginer Posted February 17, 2007 Author Share Posted February 17, 2007 Works, thanks. Link to comment https://forums.phpfreaks.com/topic/38944-mysql-query/#findComment-187355 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.