| 
		
			
			
				
			
			
				 
			
			
				
			
		 | 
		
			
			
				 
			
				
			
		 | 
	||||
| 
				Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.  You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us.  | 
		
		 
		![]()  | 
	
		
			
  | 	
	
	
		
		|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. | 
| 
		 | 
	Thread Tools | 
| 
			
			 | 
		#1 | |
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Industry Role:  
				Join Date: Oct 2018 
				Location: New Orleans, Louisiana. / Newcastle, England. 
				
				
					Posts: 1,225
				 
				
				
				
				 | 
	
	
	
	
		
			
			 So here is my problem: 
		
	
		
		
		
		
			![]() The code I'm using for that form is as follows: Quote: 
	
 ![]() I'm assuming it has something to do with the database row, although I'm not sure why the first area for 'title' isn't displaying the full entry as there is no HTML markup in that column? Any pointers or help from those of you 'in the know' please? This is actually the first time I'm trying to use CRUD on this system, I have a similar system setup for a domain management setup but that just uses 2/3 words in each column and it works fine (I copied across the edit.php exactly and just changed out the column names on this). At this point I'm honestly at a loss as to why it isnt working, I've also tried using the <textarea> instead of text input to display the data and that didn't work either 
				__________________ 
		
		
		
		
	
	Extreme Link List - v1.0  | 
|
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 Confirmed User 
			
		
			
				
			
			
			Industry Role:  
				Join Date: Aug 2006 
				Location: Poland 
				
				
					Posts: 9,229
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 You didn't wrap the value parameter of your inputs in quotes. 
		
	
		
		
		
		
			
				__________________ 
		
		
		
		
	
	Mechanical Bunny Media Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#3 | 
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Industry Role:  
				Join Date: Oct 2018 
				Location: New Orleans, Louisiana. / Newcastle, England. 
				
				
					Posts: 1,225
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 No data displays when I do, just a trailing backslash and quotation mark in the text fields. 
		
	
		
		
		
		
			
				__________________ 
		
		
		
		
	
	Extreme Link List - v1.0  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#4 | 
| 
			
			
			
			 Confirmed User 
			
		
			
				
			
			
			Industry Role:  
				Join Date: Aug 2006 
				Location: Poland 
				
				
					Posts: 9,229
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 PHP Code: 
	
			
	
				__________________ 
		
		
		
		
	
	Mechanical Bunny Media Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#5 | 
| 
			
			
			
			 Bollocks 
			
		
			
				
			
			
			Industry Role:  
				Join Date: Jun 2007 
				Location: Bollocks 
				
				
					Posts: 2,793
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 You can't put HTML tags inside an input field. So those <BR> tags need to be converted to "\r\n". 
		
	
		
		
		
		
			You could do for example, $Ingredients = str_replace("<BR>", "\r\n", $Ingredients); Then the line to display it should use <textarea> <td><textarea name="Ingredients"><?php echo $Ingredients;?></textarea></td> 
				__________________ 
		
		
		
		
	
	Interserver unmanaged AMD Ryzen servers from $73.00  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#6 | 
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Industry Role:  
				Join Date: Oct 2018 
				Location: New Orleans, Louisiana. / Newcastle, England. 
				
				
					Posts: 1,225
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Awesome, thank you both for your help with this, I have it running correctly now  
		
	
		
		
		
		
			
				__________________ 
		
		
		
		
	
	Extreme Link List - v1.0  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#7 | 
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Industry Role:  
				Join Date: Oct 2018 
				Location: New Orleans, Louisiana. / Newcastle, England. 
				
				
					Posts: 1,225
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 I'm having another really strange issue with this edit.php on the crud system, does anyone know what might be causing it not to add data to the Category field? 
		
	
		
		
		
		
			Everything else appears to be working correctly, but it isnt allowing me to add new data (when editing) to this field specifically. Its set as mediumtext in the database and only have 2 words seperated by a comma presently so the space in the column shouldn't be an issue. The code is exactly as above so should be working fine. Adding a new record isnt giving me any issues and neither is displaying or deleting a record Any thoughts on what may be causing this issue please? 
				__________________ 
		
		
		
		
	
	Extreme Link List - v1.0  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#8 | |
| 
			
			
			
			 Confirmed User 
			
		
			
				
			
			
			Industry Role:  
				Join Date: Aug 2006 
				Location: Poland 
				
				
					Posts: 9,229
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Quote: 
	
 
				__________________ 
		
		
		
		
	
	Mechanical Bunny Media Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development  | 
|
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#9 | ||
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Industry Role:  
				Join Date: Oct 2018 
				Location: New Orleans, Louisiana. / Newcastle, England. 
				
				
					Posts: 1,225
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Quote: 
	
 I'm wondering if its an issue with the connection although, no errors appear to be showing in the logs other than a modify header one to redirect to the main index.php page, which ill deal with later. Quote: 
	
 
				__________________ 
		
		
		
		
	
	Extreme Link List - v1.0  | 
||
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#10 | 
| 
			
			
			
			 Confirmed User 
			
		
			
				
			
			
			Industry Role:  
				Join Date: Aug 2006 
				Location: Poland 
				
				
					Posts: 9,229
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Did you try using my code? It fixes that headers already sent, and isn't full of sql injection exploits in literally every possible place one could be  
		
	
		
		
		
		
			Does the data you are putting into categories contain a ' ? because that would be enough to cause an SQL error in your code. 
				__________________ 
		
		
		
		
	
	Mechanical Bunny Media Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#11 | |
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Industry Role:  
				Join Date: Oct 2018 
				Location: New Orleans, Louisiana. / Newcastle, England. 
				
				
					Posts: 1,225
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Quote: 
	
 
				__________________ 
		
		
		
		
	
	Extreme Link List - v1.0  | 
|
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#12 | |
| 
			
			
			
			 Bollocks 
			
		
			
				
			
			
			Industry Role:  
				Join Date: Jun 2007 
				Location: Bollocks 
				
				
					Posts: 2,793
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Quote: 
	
 Can't see anything wrong at first glance but when trying to debug this sort of thing you should try to find out exactly what is going wrong. To do this I would change $result = mysqli_query($mysqli, "UPDATE Recipe SET Title='$Title',Ingredients='$Ingredients',Method=' $Method',Category='$Category',Edit='$Edit' WHERE RecipeID=$RecipeID"); to $query = "UPDATE Recipe SET Title='$Title',Ingredients='$Ingredients',Method=' $Method',Category='$Category',Edit='$Edit' WHERE RecipeID=$RecipeID"; $result = mysqli_query($mysqli, $query) or die(mysqli_error($mysqli) . " query was $query"); This will spit out an error if the insert failed and stop the script right there, telling you what the actual query was you were trying to use. Obviously remove this code for the live version, and set up a proper try...catch construct, this is just a quick way to see what's going on. If that doesn't give any error message the problem is somewhere else. 
				__________________ 
		
		
		
		
	
	Interserver unmanaged AMD Ryzen servers from $73.00  | 
|
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#13 | ||
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Industry Role:  
				Join Date: Oct 2018 
				Location: New Orleans, Louisiana. / Newcastle, England. 
				
				
					Posts: 1,225
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Quote: 
	
 Quote: 
	
 Found it, there an an unescaped single quotation mark at the end of confectioners' sugar. Thanks again for the help guys, looks like ill be running a quick search & replace on the database to make sure that issue doesnt happen again 
				__________________ 
		
		
		
		
	
	Extreme Link List - v1.0  | 
||
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#14 | 
| 
			
			
			
			 Bollocks 
			
		
			
				
			
			
			Industry Role:  
				Join Date: Jun 2007 
				Location: Bollocks 
				
				
					Posts: 2,793
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 You just need to do 
		
	
		
		
		
		
			$Ingredients = addslashes($Ingredients); before trying to construct the query string with it. Do it with all the other vars too. Or to be more thorough you should use mysql_real_escape_string() as Konrad suggested. 
				__________________ 
		
		
		
		
	
	Interserver unmanaged AMD Ryzen servers from $73.00  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#15 | |
| 
			
			
			
			 see you later, I'm gone 
			
		
			
			
			Industry Role:  
				Join Date: Oct 2002 
				
				
				
					Posts: 14,127
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 Quote: 
	
 . 
				__________________ 
		
		
		
		
	
	All cookies cleared!  | 
|
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#16 | 
| 
			
			
			
			 Confirmed User 
			
		
			
			
			Industry Role:  
				Join Date: Oct 2018 
				Location: New Orleans, Louisiana. / Newcastle, England. 
				
				
					Posts: 1,225
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 i just updated this to the code suggested by Konrad  
		
	
		
		
		
		
			Again, thank you all for your assistance with this 
				__________________ 
		
		
		
		
	
	Extreme Link List - v1.0  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 | 
| 
			
			 | 
		#17 | 
| 
			
			
			
			 Confirmed User 
			
		
			
				
			
			
			Industry Role:  
				Join Date: Aug 2006 
				Location: Poland 
				
				
					Posts: 9,229
				 
				
				
				
				 | 
	
	
	
	
		
		
		
		 You should always write with the security stuff already in place, that is good practice. It's gotta be there anyways and this way you'll be used to just writing it as you go. 
		
	
		
		
		
		
			
				__________________ 
		
		
		
		
	
	Mechanical Bunny Media Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development  | 
| 
		 | 
	
	
	
		
                 
		
		
		
		
		
		
		
			
			
		
	 |