하나의 데이터베이스 래퍼 클래스가 있습니다. 다른 클래스에서 쿼리를 실행하려면이 클래스 개체를 어떻게 사용해야합니까?다른 클래스에서 내 데이터베이스 클래스는 어떻게 사용해야합니까?
$liveresellerdb=new Database('host','user','spswd','db');
$fetch = $liveresellerdb->getResult($select_resellerData);
하나의 클래스에 데이터베이스 개체를 어떻게 포함해야합니까?
Class one
{
function a(){
$sql="select * from table ";
//how should i execute here my query i mean to say
//every time i can't create the new object
// i want to know the good method by which i just execute the query by
// giving the database name
}
}
마지막 질문보다 훨씬 좋은 질문입니다. – RobertPitt