<?php namespace App\Models;
use CodeIgniter\Database\ConnectionInterface;
use CodeIgniter\Model;


class Andymodel extends Model 
{
 protected $table      = 'blog';
     protected $allowedFields = ['title', 'article'];   



public function index()
{
$db = \Config\Database::connect("default");
		
		$query = $db->query("SELECT * FROM portfolio");
$row   = $query->getRowArray();
return  $row['imageTitle'].$row['Id'];

	
}

public function getAll()

{
return $this->findAll();

}





public function insertData($title,$article)
{
	$db = \Config\Database::connect("default");
echo 	$title;
echo 	$article;
	
	
	
	
	
    $sql = "INSERT INTO blog ( title,article) VALUES ('.$title.','.$article.')";
$db->query($sql);

}

public function create()

{
	echo "hello you found me";
}
}
