Jump to content

kurtos123

Members
  • Posts

    19
  • Joined

  • Last visited

Posts posted by kurtos123

  1. Tried inplementing your code Barand but i am sorry it did not give any result. I need to print on my webpage the total number of games with the name "Bratz" and "yasmine ski dressup" which are in my mysql database.  (SpelNamen means GameNames, SpelNaam means GameName).

     

     

    <?php
                               $sWhere = "";
                                $i = 0;
                                foreach($aSpelNamen AS $sSpelNaam)
                                {
                                  $sWhere .= "name LIKE '%" . $sSpelNaam . "%'";
                                  if(++$i < count($aSpelNamen))
                                  {
                                    $sWhere .= " OR ";
                                  }
                                }
    
                                $rQuery = mysql_query("SELECT COUNT(id) as total FROM " . $pre . $sqlgame . " WHERE (" . $sWhere . ")");
                                $iCount = mysql_num_rows($rQuery);
                                ?>                
                                 bratz games (<?php echo $iCount; ?>)
  2. figured this out and it works but is there a much shorter way?

     

    Figured this out and it works, but is there a much shorter way ?

     

    <?php
                               $sWhere = "";
                                $i = 0;
                                foreach($aSpelNamen AS $sSpelNaam)
                                {
                                  $sWhere .= "name LIKE '%" . $sSpelNaam . "%'";
                                  if(++$i < count($aSpelNamen))
                                  {
                                    $sWhere .= " OR ";
                                  }
                                }
    
                                $rQuery = mysql_query("SELECT id FROM " . $pre . $sqlgame . " WHERE (" . $sWhere . ")");
                                $iCount = mysql_num_rows($rQuery);
                                ?>                
                                 bratz spellen (<?php echo $iCount; ?>)
    
  3.  [ code ]<?php
    $iKolommen = 5;
    $iGamesPerPagina = 60;
    $aSpelNamen = array(
      "bratz",
        "yasmine ski dressup",
             );
    ?> [ / code ]

     

    I use above code to determine all games with name bratz and yasmin ski dressup in my database and to print them on my webpage.

     

    How can i print the exact number of all the games with those names ?

    Can you give me the exact code because i am a newbie in php.

    I tried a code but it only gives the number 2 because it counts the names and not the amount.

     

    Many thanks for your help in advance.

  4. The implementation of the easy slider was not that easy for me losing more than a day of my precious time. if any one can help please do. The problem is that the first image does not load well to the left side with a bit of the last picture can be seen on loading, after that the slider loads well

     

    Please check my website for the slider between the purple bars on top:

    http://www.crocgame.com

     

    If you need some code let me know.

    Thanks for help in advance

    Best regards,

    Kurt

  5. The result of below code can be seen on http://www.crocgame.com under Recommended Games (between purple on top)

    My Question: Is it possible adjusting my code here and there, to show 5 new games after a certain time duration on the same index page so that images and corresponding urls (purple buttons) rotate on the webpage and it will be less boaring.

    Anyone who helps me fix this can get 15 dollar on your paypal because i think you need to put some work in it.

    Best regards,

    Kurt

     

     

     

     

    <?php
    $iKolommen = 5;
    ?>
          <?php
                  include_once("config.php");                           
                  ?>
                  <?php
                  $rQuery = mysql_query("SELECT * FROM " . $pre . $sqlgame . " WHERE  (name LIKE '%candy crush%') OR (name LIKE '%goodgame farmer%') OR (name LIKE '%rummy%') OR (name LIKE '%goodgame empire%') OR (name LIKE '%Gorillaz Tiles%') OR (name LIKE '%goodgame shadow kings%') OR (name LIKE '%my free zoo%') OR (name LIKE '%my free farm%') OR (name LIKE '%kapi hospital%') OR (name LIKE '%garbage garage%')  OR (name LIKE '%11 legends%') OR (name LIKE '%dansen met de sterren%') OR (name LIKE '%skyrama%') OR (name LIKE '%seafight%') OR (name LIKE '%battlestar galactica%') OR (name LIKE '%pirate storm%') OR (name LIKE '%rising cities%') OR (name LIKE '%zoo mumba%') OR (name LIKE '%drakensang online%') OR (name LIKE '%uptasia%') ORDER BY RAND() LIMIT 5");
                  $iCount = mysql_num_rows($rQuery);
                  ?>
                  <?php
                  if(!$iCount)
                  {
                    ?>
                      <span style="color: white; text-align: center;">No games were found.</span>
                    <?php
                  }
                  else
                  {
                    ?>
                    <table width="780" cellpadding="0" cellspacing="0" align="center">
                      <tr>
                        <?php
                        $i = 1;
                        while($aGame = mysql_fetch_assoc($rQuery))
                        {
                          ?>
                          <td width="<?php echo (100 / $iKolommen); ?>%" align="center" style="text-align: center;">
                            <?php
                            if($aGame['cijfer'] != 0 AND $aGame['stemmen'] != 0)
                            {
                              $iCijfer = floor($aGame['cijfer'] / $aGame['stemmen']);
                            }
                            else
                            {
                              $iCijfer = 0;
                            }
                            $sSpelUrl = str_replace(" ", "-", $aGame['name']);
                            ?>
           <div style="float: left; margin-left:2px; width: <?php echo ($i == 2 OR $i == 3) ? "152" : "153"; ?>px; text-align: center;">
                            <a target="_blank" href="http://www.crocgame.com/games.php/<?php echo $sSpelUrl; ?>.html" class="recommendedLink">
                              <span class="iconwrapper"><img src="<?php echo $aGame['screenshoturl']; ?>" width="140" height="89" alt="recommend games" /></span>
                              <span class="recomendedButton" style="margin: 5px auto auto auto;">
                      <?php echo strlen($aGame['name']) > 19 ? substr($aGame['name'], 0, 19) . ".." : $aGame['name']; ?>
                      </span>
                  </a>
              </div></td>     

    ?>

  6. Code so far:

     

    <?php
    include "config.php";
    // initiate counter
    $i = 0;
    $rQuery = mysql_query("SELECT * FROM " . $pre . "$sqlgame WHERE cijfer / stemmen >= 10 ORDER BY views DESC LIMIT 10");
    while($aGame = mysql_fetch_assoc($rQuery))
        if($aGame['cijfer'] != 0 AND $aGame['stemmen'] != 0)
        {
            $cijfer = floor($aGame['cijfer'] / $aGame['stemmen']);
        }
        else
        {
            $cijfer = 0;
        }
        $sSpelNaam = str_replace(" ", "-",$aGame['name']);

        // increment counter by one
        $i++;

        // output counter
        echo "$i.<font color='#333333'>• <a href=\"http://www.crocgame.com/games.php/" . $sSpelNaam . ".html\" target='blank' onmouseover=\"ddrivetip('<img src=\'" . $aGame['screenshoturl'] . "\' width=\'170\' height=\'140\' alt=\'" . $aGame['name'] . "\'><br /><b>" . $aGame['name']  . "</b>');\" onmouseout='hideddrivetip();'>" . $aGame['name'] . " " . $aGame['extra'] . "</a></font><br />" . PHP_EOL;

    }
    ?>
     

     

    STill not working with above code get mysql error: Parse error: syntax error, unexpected '}' in/home/crocgame/domains/crocgame.com/public_html/beste_games1.phpon line 23                     Please help !

  7. Get a mysql error on line 6 with: while($aGame = mysql_fetch_assoc($rQuery) ) now:  Mysql_fetch _assoc():supplied argument is not a valid MySQL result resource in /home/crocgame/domains/crocgame.com/public_html/beste_games1.php on line 6

  8. :confused: Updated my browser and got error message

    Parse error: syntax error, unexpected '{' in /home/crocgame/domains/crocgame.com/public_html/beste_games1.php on line 7

    I am bad in php so please help me further...

    Many thanks for help!

     

    <?php
    include "config.php";
    // initiate counter
    $i = 0;

    while($aGame = mysql_fetch_assoc($rQuery)
    {
        if($aGame['cijfer'] != 0 AND $aGame['stemmen'] != 0)
        {
            $cijfer = floor($aGame['cijfer'] / $aGame['stemmen']);
        }
        else
        {
            $cijfer = 0;
        }
        $sSpelNaam = str_replace(" ", "-",$aGame['name']);

        // increment counter by one
        $i++;

        // output counter
        echo "$i. <font color='#333333'>• <a href=\"http://www.crocgame.com/games.php/" . $sSpelNaam . ".html\" target='blank' onmouseover=\"ddrivetip('<img src=\'" . $aGame['screenshoturl'] . "\' width=\'170\' height=\'140\' alt=\'" . $aGame['name'] . "\'><br /><b>" . $aGame['name']  . "</b>');\" onmouseout='hideddrivetip();'>" . $aGame['name'] . " " . $aGame['extra'] . "</a></font><br />" . PHP_EOL;

    }

    ?>

  9. I am displaying the top 10 games on my website but i want this list numbered from 1 to 10.

    How do i inplement this in my code ? Is it posible also the ad numbered images, and how do i do that?

     

    Here is my code so far:

     

    <?php
    include "config.php";
    $rQuery = mysql_query("SELECT * FROM " . $pre . "$sqlgame WHERE cijfer / stemmen >= 10 ORDER BY views DESC LIMIT 10");
    while($aGame = mysql_fetch_assoc($rQuery))
    {
      if($aGame['cijfer'] != 0 AND $aGame['stemmen'] != 0)
      {
        $cijfer = floor($aGame['cijfer'] / $aGame['stemmen']);
      }
      else
      {
        $cijfer = 0;
      }
      $sSpelNaam = str_replace(" ", "-",$aGame['name']);
      echo "<font color='#333333'>• <a href=\"http://www.crocgame.com/games.php/" . $sSpelNaam . ".html\" target='blank' onmouseover=\"ddrivetip('<img src=\'" . $aGame['screenshoturl'] . "\' width=\'170\' height=\'140\' alt=\'" . $aGame['name'] . "\'><br /><b>" . $aGame['name']  . "</b>');\" onmouseout='hideddrivetip();'>" . $aGame['name'] . " " . $aGame['extra'] . "</a></font><br />" . PHP_EOL;
    }
    ?>
     

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.