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? 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 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! Link to comment https://forums.phpfreaks.com/topic/557-gathering-mysql-info/#findComment-1895 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.