• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[URGENT] My website deletes all news

luciano01

New Member
Joined
Aug 6, 2017
Messages
33
Reaction score
1
Guys, when I'm going to post something on my site in the "News Archive" part it posts normally, but if I'm going to edit it only edits the first post made (no matter which one I select, it always goes to the first post), and when i delete some publication it erases all.



Please help me with this, I really need it! Rep ++
 
Find $SQL->fieldName('id') . " = ".(int) $thread['first_post']." LIMIT 1")->fetch();
Change (int) $thread['first_post'] to $post_id
That should fix editing.
 
Your id field is not a Primary Key, modify the table structure and set the ID to be a primary key. (you'll have to delete the existing rows or change the id to 1 and 2 or something different)
 
You're only allowed to post in Portuguese in the Portuguese board.
Modify the following query with your table name
SQL:
 ALTER TABLE table_name MODIFY id int(11) AUTO_INCREMENT PRIMARY KEY
 
Remove all the entries in the table and try run this code (replacing the table name):
ALTER TABLE table_name AUTO_INCREMENT=100;
 
After removing everything, does it look like this?
SQL:
SELECT * FROM `z_forum` WHERE 1
ALTER TABLE table_name MODIFY id int(11) AUTO_INCREMENT PRIMARY KEY
ALTER TABLE table_name AUTO_INCREMENT=100
Post automatically merged:

This is my code z_forum

SQL:
CREATE TABLE `z_forum` (
  `id` int(11) NOT NULL,
  `first_post` int(11) NOT NULL DEFAULT '0',
  `last_post` int(11) NOT NULL DEFAULT '0',
  `section` int(3) NOT NULL DEFAULT '0',
  `replies` int(20) NOT NULL DEFAULT '0',
  `views` int(20) NOT NULL DEFAULT '0',
  `author_aid` int(20) NOT NULL DEFAULT '0',
  `author_guid` int(20) NOT NULL DEFAULT '0',
  `post_text` text NOT NULL,
  `post_topic` varchar(255) NOT NULL,
  `post_smile` tinyint(1) NOT NULL DEFAULT '0',
  `post_date` int(20) NOT NULL DEFAULT '0',
  `last_edit_aid` int(20) NOT NULL DEFAULT '0',
  `edit_date` int(20) NOT NULL DEFAULT '0',
  `post_ip` varchar(15) NOT NULL DEFAULT '0.0.0.0',
  `icon_id` int(11) NOT NULL,
  `news_icon` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `z_forum`
--


-- --------------------------------------------------------
 
Last edited:
I told you to change the table_name for the table's name, here's the code:
Code:
ALTER TABLE z_forum MODIFY id int(11) AUTO_INCREMENT PRIMARY KEY
 
I think that either the sql or the forum.php, no?
Post automatically merged:

if I put this NOT NULL DEFAULT '0',

in place of NOT NULL ,?
 
Last edited:
Back
Top