Jump to content


Photo

news system adding 2 instead of 1


  • Please log in to reply
3 replies to this topic

#1 Shadow Hatake

Shadow Hatake
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 04 March 2006 - 09:15 PM

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:
    } 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);
        }


#2 Shadow Hatake

Shadow Hatake
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 06 March 2006 - 12:19 AM

anyone? :/

#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 06 March 2006 - 12:48 AM

if($submit)
{
insert code
}


try
good luck


Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#4 Shadow Hatake

Shadow Hatake
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 06 March 2006 - 01:02 AM

Huh? I don't get how that's stop it from adding 2 news entries to the databse.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users