Shadow Hatake Posted March 4, 2006 Share Posted March 4, 2006 Okay so I made this news system and it worked fine for a while, but now it's acting up and adding a blank entry to the databse when I post a piece of news.Code from confirm.php:[code] } elseif( $_GET['p'] == 'news' ) { $stat_chk_query = 'SELECT status FROM users WHERE name = "'.$_SESSION['valid_user'].'"'; $result = mysql_query( $stat_chk_query ); $row = @mysql_fetch_array( $result, MYSQL_ASSOC ); if( $row['status'] == 2 ) { $news_add_query = 'INSERT INTO news( title, news, date, user )'; $news_add_query .= 'VALUES( "'.$news_title.'", "'.$news_content.'", NOW(), "'.$_SESSION['valid_user'].'" )'; $result = mysql_query( $news_add_query ); if( $result ) { content_box( $news_pos_title, $news_pos_content ); } else { content_box( $news_neg_title, $news_neg_content); } } else { content_box( $news_err_title, $news_err_msg); }[/code] Quote Link to comment https://forums.phpfreaks.com/topic/4107-news-system-adding-2-instead-of-1/ Share on other sites More sharing options...
Shadow Hatake Posted March 6, 2006 Author Share Posted March 6, 2006 anyone? :/ Quote Link to comment https://forums.phpfreaks.com/topic/4107-news-system-adding-2-instead-of-1/#findComment-14494 Share on other sites More sharing options...
redarrow Posted March 6, 2006 Share Posted March 6, 2006 if($submit){insert code}trygood luck Quote Link to comment https://forums.phpfreaks.com/topic/4107-news-system-adding-2-instead-of-1/#findComment-14501 Share on other sites More sharing options...
Shadow Hatake Posted March 6, 2006 Author Share Posted March 6, 2006 Huh? I don't get how that's stop it from adding 2 news entries to the databse. Quote Link to comment https://forums.phpfreaks.com/topic/4107-news-system-adding-2-instead-of-1/#findComment-14507 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.