I have Following code

function updateHitCounter($id,$PHPSESSID,$type){
$connection = mysql_connect("$host","$username","$password");
if ($connection == false){
echo mysql_errno().": ".mysql_error()."<BR>";
if($type=="out") $query = "select * from sites where id='$id'";
elseif($type=="in") $query = "select * from sites where id='$id'";
$result = mysql_db_query ("$dbase", $query);
if ($result){
$numOfRows = mysql_num_rows ($result);
$hitsIn= mysql_result ($result, $i, "hitsOut");
$hitsOut= mysql_result ($result, $i, "hitsIn");
echo mysql_errno().": ".mysql_error()."<BR>";
$query = "UPDATE sites SET  hitsOut ='$hits'  WHERE id='$id'";
$result = mysql_db_query ("$dbase", $query);
if (!$result){
echo mysql_errno().": ".mysql_error()."<BR>";
mysql_close ();

When I run it i get this error:
 Warning: Unable to jump to row 0 on MySQL result index 4 in c:\program
files\apache group\apache\htdocs\phptopsites\top100.php on line 222

Guys is there anyway i can avoid it?

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to