ecopetition Posted July 30, 2008 Share Posted July 30, 2008 Hello, I'm trying to make an attachments mod for a forum software. It is to allow me to upload attachments in a forum post, and although it works it also returns the following error in the header: [NuclearBB Notice] Undefined offset: 1 (Line 350, File viewtopic.php) Codes: // Check if post has an attachment $sql = "SELECT human_name FROM attachments WHERE post_id = ". $posts[$i]['post_id'] ." "; $result = $db->query($sql); while($row = $db->fetch_assoc($result)) { $attachment_name[] = $row; } $template->assign_block_vars('post', array( 'ATTACHMENT_NAME' => ($attachment_name[$i]['human_name']), )); The variable "$i" controls the offset depending on which post I'm on, and not every post has an attachment (and therefore an according line in the "attachments" table). Thank you for your help. Link to comment https://forums.phpfreaks.com/topic/117370-solved-offsets-not-working/ Share on other sites More sharing options...
ecopetition Posted July 30, 2008 Author Share Posted July 30, 2008 Any help please? Link to comment https://forums.phpfreaks.com/topic/117370-solved-offsets-not-working/#findComment-603720 Share on other sites More sharing options...
ecopetition Posted July 30, 2008 Author Share Posted July 30, 2008 S'ok I found a way around it. Link to comment https://forums.phpfreaks.com/topic/117370-solved-offsets-not-working/#findComment-603727 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.