![]()  | 
	
| 
			
			 | 
		#1 (permalink) | 
| 
			
			 Junkie 
			
			
			
			
			Location: RI 
				
				
				
				
				
				 | 
	
	
	
		
		
			
			 
				
				[PHP/MySQL] Query problem
			 
			Alright, so I got MySQL v. 4.0.18-standard, and php 4.3.4 as background. 
		
		
		
		
		
		
		
			What I'm tryin to do is create a script that'll create a table thru a table. Some people may have the PHP fast & easy development and I'm trying to copy the one that they have in the book. I've looked at the php.net, and it didn't really answer my question though. Here's the error I get. You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 't (Array[0]),)' at line 1 This is in the table creation script PHP Code: 
	
			
	This is in the table selection field. PHP Code: 
	
			
	If you have any references about this that I can look at, I would be greatly appriciative. Last edited by Fallon; 04-01-2004 at 06:03 PM..  | 
| 
		 | 
	
	
| 
			
			 | 
		#2 (permalink) | 
| 
			
			 Pure Chewing Satisfaction 
			
			
			
			
				
			
			Location: can i use bbcode [i]here[/i]? 
				
				
				
				
				
				 | 
	
	
	
		
		
		
		 I think the problem is that the last time this for loop goes through: 
		
		
		
		
		
			PHP Code: 
	
			
	Do a check to see if you're at the last iteration of the loop. If you are, don't print the comma. Hopefully that helps. Such as: PHP Code: 
	
			
	
				__________________ 
		
		
		
		
		
			Greetings and salutations. Last edited by Moskie; 04-01-2004 at 08:52 PM..  | 
| 
		 | 
	
	
| 
			
			 | 
		#3 (permalink) | 
| 
			
			 Crazy 
			
			
			
			
			Location: Salt Town, UT 
				
				
				
				
				
				 | 
	
	
	
		
		
			
			 
				
				A common, but small mistake
			 
			This happens all the time. 
		
		
		
		
		
		
	when your loop goes through, it will end up with an extra comma on the end, remove it with rtrim() after your loop is finished PHP Code: 
	
			
	 | 
| 
		 | 
	
	
| Tags | 
| php or mysql, problem, query | 
		
  | 
	
		 |