hey people
please tell me what to do , when ever i use mysql_fetch_array(data) i get this error :

Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in C:\xampp\htdocs\awah.biz2\classes\class_lib.php on line 34

please tell me what to do , here is the class_lib.php:

<?php
class db
{
var $do;
function __construct()
{
}
function connect()
{
mysql_connect("localhost","root","")or die("cant connect to MySQL server : ".mysql_error());
}
function select()
{
mysql_select_db("awah7870_index") or die("cant select the db : ".$select);
}
function query($data)
{
$q = mysql_query($data);
if($q)
{
echo "";
}
else
{
echo "Error : ".mysql_error();
}
}
function close()
{
mysql_close();
}
function fetch($data)
{
mysql_fetch_array($data);
}
}
?>

you have to pass $q to the function fetch() not $data..
mysql_fetch_array() function only takes resource returned by mysql_query() function.

or change your fetch() like this:

function fetch($data)
{
   $q = mysql_query($data);
   mysql_fetch_array($q);
}

you have to pass $q to the function fetch() not $data..
mysql_fetch_array() function only takes resource returned by mysql_query() function.

or change your fetch() like this:

function fetch($data)
{
   $q = mysql_query($data);
   mysql_fetch_array($q);
}

change mysql_fetch_array to mysql_fetch_assoc
function fetch($data)
{
$q = mysql_query($data);
mysql_fetch_assoc($q);
}

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.