graham23s Posted August 18, 2007 Share Posted August 18, 2007 Hi Guys, i know there are 2 ways to query mysql: 1st: longer $query_insert_2 = "INSERT INTO `forum_posts` (`topic_id`,`user_id`,`date`,`body`) VALUES ('','$poster',now(),'$for_id','$body')"; $result_insert_2 = mysql_query($query_insert_2) or die (mysql_error()); 2nd smaller mysql_query("SELECT `topic_id` FROM `forum_topics` WHERE `id`='$for_id'"); i usually use the first one and do this to fetch the rows: $row = mysql_fetch_array($result_insert_2) then do: $id = $row['id']; but im not sure how i would go about getting the rows using the 2nd way any help would be appreciated thanks guys Graham Link to comment https://forums.phpfreaks.com/topic/65606-solved-question-on-querying-mysql/ Share on other sites More sharing options...
soycharliente Posted August 18, 2007 Share Posted August 18, 2007 The same way? Link to comment https://forums.phpfreaks.com/topic/65606-solved-question-on-querying-mysql/#findComment-327620 Share on other sites More sharing options...
graham23s Posted August 18, 2007 Author Share Posted August 18, 2007 so basically this: $query = mysql_query("SELECT `topic_id` FROM `forum_topics` WHERE `id`='$for_id'"); then $row = mysql_fetch_array($query); right under my nose lol cheers Graham Link to comment https://forums.phpfreaks.com/topic/65606-solved-question-on-querying-mysql/#findComment-327630 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.