sqlite returns column names as table.name, not just name
This commit is contained in:
		
							parent
							
								
									678910fb13
								
							
						
					
					
						commit
						bc3c2d5a5b
					
				@ -29,7 +29,8 @@ class Image {
 | 
				
			|||||||
	public function Image($row=null) {
 | 
						public function Image($row=null) {
 | 
				
			||||||
		if(!is_null($row)) {
 | 
							if(!is_null($row)) {
 | 
				
			||||||
			foreach($row as $name => $value) {
 | 
								foreach($row as $name => $value) {
 | 
				
			||||||
				// FIXME: some databases use table.name rather than name
 | 
									// some databases use table.name rather than name
 | 
				
			||||||
 | 
									$name = str_replace("images.", "", $name);
 | 
				
			||||||
				$this->$name = $value; // hax
 | 
									$this->$name = $value; // hax
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			$this->posted_timestamp = strtotime($this->posted); // pray
 | 
								$this->posted_timestamp = strtotime($this->posted); // pray
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user