hi there i would like to ask something im not really that good into class but i am trying to challenge myself to learn more 🙂
here it goes
<?
//filename : commonClass.php
class query {
function queryList($sql, $link, $page, $rowsPerPage='10', $pageLimit='10', $var1='', $value1='', $var2='', $value2='') {
?>
and the code is like this
<?
//filename : test.php
include("dbConnect.php");
include("commonClass.php");
$sql = "select * from sections";
$queryList = new queryList( $sql, 'test.php', $page, 15, 10 );
$res = mysql_query ($queryList->sql);
while ( list ( $sectionId, $sectionCode, $sectionName, $section ) = mysql_fetch_row($res) ){
print $sectionName.'<br>';
}
?>
but this just gives me an error like this
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in c:\webserver\home\oliver\test.php on line 7
what do u think should be the problem here?
try changing the query class to queryList and it will give you no error.