emediastudios Posted June 16, 2008 Share Posted June 16, 2008 <?PHP if($_POST[password] == "" && $_SESSION[passed] != "y"){ $content .= "<form method='post' action='admin.php'><input type='password' name='password' value='password'><input type=submit></form>"; } else if($_POST[password] != ""){ if($password == $_POST[password]){ $_SESSION[passed] = "y"; } else{ echo "<script>window.location = 'admin.php';</script>"; } } if($_SESSION[passed] == "y"){ $path = "uploads/"; $path = $path . basename( $_FILES['uploadedfile']['name']); $name = basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $path)) { echo "File ". basename( $_FILES['uploadedfile']['name']). " Uploaded"; } else{ echo "Error"; } $time=date("Y-m-d"); $sql = mysql_query("INSERT INTO newsletter VALUES('NULL','$name','$date')") or die(mysql_error()); $content .= "Newslettr Uploaded"; echo $content; } else{ echo "You Must Be Logged In To Do That"; } ?> Link to comment https://forums.phpfreaks.com/topic/110400-solved-out-of-range-value-adjusted-for-column-nl_id-at-row-1/ Share on other sites More sharing options...
shane07 Posted June 16, 2008 Share Posted June 16, 2008 you can use $sql = mysql_query("INSERT INTO newsletter VALUES('$name','$date')") or die(mysql_error()); if nl_id is auto incremented, as far as I understand. Link to comment https://forums.phpfreaks.com/topic/110400-solved-out-of-range-value-adjusted-for-column-nl_id-at-row-1/#findComment-566391 Share on other sites More sharing options...
emediastudios Posted June 16, 2008 Author Share Posted June 16, 2008 File Newsletter June.pdf UploadedColumn count doesn't match value count at row 1 Link to comment https://forums.phpfreaks.com/topic/110400-solved-out-of-range-value-adjusted-for-column-nl_id-at-row-1/#findComment-566417 Share on other sites More sharing options...
emediastudios Posted June 16, 2008 Author Share Posted June 16, 2008 File Newsletter June.pdf UploadedColumn count doesn't match value count at row 1 My SQL CREATE TABLE IF NOT EXISTS `newsletter` ( `nl_id` int(11) NOT NULL auto_increment, `nl_file` text NOT NULL, `nl_date` text NOT NULL, KEY `nl_id` (`nl_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; Link to comment https://forums.phpfreaks.com/topic/110400-solved-out-of-range-value-adjusted-for-column-nl_id-at-row-1/#findComment-566419 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.