include '../config.php'; if(isset($_REQUEST['story_id'])) { $story_id = $_REQUEST['story_id']; $story_select = "select * from str_story a,str_category b where a.category_id=b.category_id and story_id=".$story_id; } else { $story_select = "select * from str_story a,str_category b where a.category_id=b.category_id and a.category_id=2 order by rand() limit 1"; } $rs_story = mysql_query($story_select,$link); $row_story = mysql_fetch_array($rs_story); $story_id = $row_story['story_id']; $story_title = $row_story['story_title']; $story_sub_title = $row_story['story_sub_title']; $story_text = $row_story['story_text']; $category_name = $row_story['category_name']; mysql_query("update str_story set story_read_counter=story_read_counter+1 where story_id=".$story_id , $link); ?>