providers page
This commit is contained in:
@@ -6,11 +6,18 @@ use CodeIgniter\Model;
|
||||
|
||||
class Product_model extends Model
|
||||
{
|
||||
public function getProducts() {
|
||||
$mysql = "SELECT * FROM products ORDER BY id ASC ";
|
||||
public function getProducts($productId = '') {
|
||||
if ( $productId == '' ){
|
||||
$mysql = "SELECT * FROM products ORDER BY id ASC ";
|
||||
}else
|
||||
{
|
||||
$mysql = "SELECT * FROM products WHERE product_id='$productId' ";
|
||||
}
|
||||
|
||||
$db = db_connect();
|
||||
$query = $db->query($mysql);
|
||||
return $query->getResult('array');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user