redgunner Posted November 16, 2010 Share Posted November 16, 2010 For some reason this only allows one SQL to be added... // SQL Connection $username="monstert_admin"; $password="admin"; $database="monstert_admin"; $connection = mysql_connect("localhost", $username, $password) or die("Connection Failure to Database"); // Select Database mysql_select_db($database, $connection) or die ($database . "No Database" . $username); //Select everything from the the table $MyQuery = "SELECT * FROM photos"; $retrieve = mysql_query($MyQuery) or die(mysql_error()); if(mysql_num_rows($retrieve) != 0): $row = mysql_fetch_assoc($retrieve); else: echo ''; endif; if(isset($_POST['Submit']) && !$errors) { $url = $newname; include('img.php'); $image = new SimpleImage(); $image->load($url); $image->resize(500,315); $image->save($newname); mysql_query("INSERT INTO photos (url) VALUES ('$url')"); echo "File Uploaded Successfully as <i> "; echo $newname; echo "</i>"; } What would the issue be? I only have two columns - ID and url Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/218878-only-one-entry-added/ Share on other sites More sharing options...
Pikachu2000 Posted November 16, 2010 Share Posted November 16, 2010 Perhaps you could clarify a bit. What is the script doing/not doing, and how is the result that you were expecting different? Quote Link to comment https://forums.phpfreaks.com/topic/218878-only-one-entry-added/#findComment-1135149 Share on other sites More sharing options...
redgunner Posted November 16, 2010 Author Share Posted November 16, 2010 Forgot to create auto increment! Resolved Quote Link to comment https://forums.phpfreaks.com/topic/218878-only-one-entry-added/#findComment-1135152 Share on other sites More sharing options...
herghost Posted November 16, 2010 Share Posted November 16, 2010 Well you are only asking the code to input an url, where is the id coming from? If you want this to count automatically you have to set the column to auto_increment Oops - Sorry beat me to it! Quote Link to comment https://forums.phpfreaks.com/topic/218878-only-one-entry-added/#findComment-1135153 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.