Help with some PHP

dharmil

New Member
Messages
1,656
Reaction score
0
Points
0
Help with some PHP Arcade Mod i Made

i creadred a arcde mod but i mest up doing the page numbering for the games
can some opne help out with tihs
the page is loated : http://www.dharmil.info/arcade.php
Source Code: http://www.dharmil.info/arcade.phps

i tihnk this is where i mest up:
PHP:
    <?php 
    // Define search query
    if (strlen($s_search)>0) $sqlquery .= " WHERE {$s_rsearch} LIKE '%{$s_search}%'";
    // Did we use a category or the search box?
    if ($s_cat>0)
    {
        if (strlen($s_search)>0)
        {
            $sqlquery .= " AND game_cat = {$s_cat} ORDER BY game_name {$s_sorto}";
        }
        else
        {
            $sqlquery .= " WHERE game_cat = {$s_cat} ORDER BY game_name {$s_sorto}";
        }
    }
    else
    {
        $sqlquery .= " ORDER BY {$s_sortby} {$s_sorto}";
    }?>

PHP:
<?
    // Fetch game count and generate pages, after using filter
    $result = mysql_query('SELECT COUNT(game_id) FROM arcade_games '.$sqlquery);
    $num_games2 = mysql_result($result);
    $currec = $s_page * $s_nump;
    $kolvop = ceil($num_games2 / $s_nump);
    $cp = ($kolvop == 0? 1 : $kolvop);
    $nump = $s_nump;
    // Generate page links
     if ($cp>1)
        {
            echo '<p>', Pages,':';
            for ($i=1;$i<=$cp;$i++)
            if (($i-1)==$s_page) echo " $i ";
            else echo ' <a href="'.$_SERVER['PHP_SELF'].'?page='.($i-1).'">'.$i.'</a> ';
        }
        echo '<p>';
    // Output Games, highscores, description
    ?>

This is the Error i get

Code:
Warning: Wrong parameter count for mysql_result() in /home/dharmilx/public_html/dharmil/arcade.php on line 332


EDIT: Problem Solved A modorater can close this if they want
 
Last edited:
Top