Jeff23 Posted June 8, 2003 Share Posted June 8, 2003 Actually, I\'ve been doing pretty well, but one thing has been bothering me. What is the command to set a variable from a specific row like this: mysql_query("SELECT pid FROM marketb WHERE price=\'$price\'"); $pid = ??? How do I set $pid = \'pid\' from the table? Quote Link to comment https://forums.phpfreaks.com/topic/557-gathering-mysql-info/ Share on other sites More sharing options...
effigy Posted June 9, 2003 Share Posted June 9, 2003 $q = mysql_query(\"SELECT pid FROM marketb WHERE price=\'$price\'\"); $r = mysql_fetch_array($q); $pid = $r[\'pid\']; or you could use mysql_result Quote Link to comment https://forums.phpfreaks.com/topic/557-gathering-mysql-info/#findComment-1875 Share on other sites More sharing options...
Jeff23 Posted June 9, 2003 Author Share Posted June 9, 2003 Hey, thanks a lot for that. It\'s really funny how I figured out the hardest part of that code (the parts I didn\'t post), but just couldn\'t figure out what needed to be done to register the stupid variable! Thanks again! Quote Link to comment https://forums.phpfreaks.com/topic/557-gathering-mysql-info/#findComment-1895 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.