Jump to content

Hall of Famer

Members
  • Posts

    314
  • Joined

  • Last visited

Posts posted by Hall of Famer

  1. Well I generated a quiz script for my site, which uses a template with certain format. I cant get it to work though, since the quiz wouldnt fit in the desired position after adding the template codes. Do anyone of you know how to fix it? I have added a screenshot, a link to the quiz url and the entire php codes in this thread, please help...

     

    Screenshot:

    2ij0ldz.jpg

     

    Url:

    http://www.pokemansion.net/quiz2.php

     

     

     

    [attachment deleted by admin]

  2. umm got these two error messages...

     

     

    Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /home7/pkmnhofc/public_html/adoptables/fishing.php on line 1062

     

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home7/pkmnhofc/public_html/adoptables/fishing.php on line 1063

     

    BTW, these were the codes around the line 1062 before I made this thread, in which the delete sql query command did not work properly. Anyway idea how to fix this?

     

    else if($act == "capturemagikarp"){
    
    $promocode = "none";
    $quantity = "1";
    
    $article_content ="<center><table style='color: #FFFF31; background: Green; width: 400px; border: 1px solid #9BDDFF;'><tr><td>
    <br><center><img src='http://www.pokemonelite2000.com/sprites/plmfa/129.png' border='0'>
    <br><form name='form1' method='get' action='doadopt.php'>
      <p>Name: 
        <input name='name' type='text' id='name'>
        <input name='id' type='hidden' id='id' value='129'>
        <input name='promocode' type='hidden' id='promocode' value='".$promocode."'>
      </p>
      <p>
        <input type='submit' name='Submit' value='Capture'>
    </p>
    </form></center><br><br></td></tr></table></center>";
    
    
    
    $query = "SELECT * FROM ".$prefix."user_inventory WHERE item_owner = '$loggedinname' AND item_name = 'Pokeball'";
                      $result = mysql_query($query);
                      $num1 = mysql_numrows($result);
                      $item_data = mysql_fetch_array($result);
                      
                      $item_amount = $item_data['item_amount'];
                      
                      $newquantity = $item_amount - $quantity;
    
    $query = "UPDATE ".$prefix."user_inventory SET item_amount = '$newquantity' WHERE item_owner = '$loggedinname' AND item_name = 'Pokeball'";
                      $result = mysql_query($query);
                      
                      if($newquantity == "0"){
                        $query = "DELETE FROM ".$prefix."user_inventory WHERE item_owner = '$loggedinname' AND item_name = '$item_name'";
                      $result = mysql_query($query);
                      }
    
    
    }
    

  3. Well this sounds weird, but it happens. I have an itemshop script, and I wanna code a system that automatically delete the database entry once the variable item amount falls to 0. However, this doesnt happen when I check phpmyadmin, and the item remains in the database even after the amount becomes 0. In fact, the amount can become negative at times, which annoys me.

     

    2h37v9i.jpg

     

    The code of deleting sql entry looks like this:

     

    if($continue == "yes"){
    $query = "SELECT * FROM ".$prefix."user_inventory WHERE item_owner = '$loggedinname' AND item_name = '$item_name'";
                      $result = mysql_query($query);
                      $num = mysql_numrows($result);
                      $item_data = mysql_fetch_array($result);
                      
                      $item_amount = $item_data['item_amount'];
                      
                      $newquantity = $item_amount - $quantity;
    
    $query = "UPDATE ".$prefix."user_inventory SET item_amount = '$newquantity' WHERE item_owner = '$loggedinname' AND item_name = '$item_name'";
                      $result = mysql_query($query);
                      
                      if($newquantity == "0"){
                        $query = "DELETE FROM ".$prefix."user_inventory WHERE item_owner = '$loggedinname' AND item_name = '$item_name'";
                      $result = mysql_query($query);
                      }
                      
    

     

    What part of the codes should I edit to fix this issue? Thanks.

  4. Well sorry to bother you guys with this seemingly stupid problem. I have a file hmgc.php from a friend, and I try to modify the codes myself to add some sort of features to my site. Unfortunately, I am unable to proceed because of this error:

     

    Parse error: syntax error, unexpected T_STRING in /home7/pkmnhofc/public_html/adoptables/hmgc.php on line 115

     

    The file is attached in this message already, please take a look at it and tell me what exactly was wrong? I tried to add another if-elseif-else statement within an else statement, may this be a problem? Also this is the scripts around line 115 looks like:

     

    if($act == "2"){
      $query = "SELECT * FROM ".$prefix."user_inventory WHERE item_owner='$loggedinname' and item_name='Old Rod'";
      $result = mysql_query($query);
      $num = mysql_numrows($result);
      
      if($num == 0){
       $article_title = "Oops it appears that you do not have an Old Rod yet...";
       $article_content = "<center><table style='color: #FFFF31; background: Green; width: 400px; border: 1px solid #9BDDFF;'><tr><td>
       It seems that you do not have an Old Rod in your inventory yet, are you sure it is the best choice for you to fish without a rod?<br><br>
       To fix this issue, simply go back and take Fishing Quiz. You syhould be able to acquire an Old Rod for yourself if you answer all these
       questions successfully. Trust me, they aint really hard at all if you know something about pokemon and the fishing mechanism already.<br>
       <br><a href='fishingquiz.php'>Take the Fishing Quiz now!!!</a> 
      }
      
      else{
       $randnum1 = rand(1, 500);
    
        if($randnum1 >= 1 and $randnum1 < 225){
          $article_title = "You got a Magikarp";
          $article_content = "<center><table style='color: #b60400; background: black; width: 400px; border: 1px solid #b60400;'><tr><td><br><br>
          Now is your chance to adopt a wild Magikarp!</td></tr></table></center>";
    
          }
          else if($randnum1 >= 225 and $randnum1 < 250){
          $article_title = "You got a Goldeen";
          $article_content = "<center><table style='color: #b60400; background: black; width: 400px; border: 1px solid #b60400;'><tr><td><br><br>
          Now is your chance to adopt a wild Goldeen</td></tr></table></center>";
    
          }
          else{
          $article_title = "Not even a bite";
          $article_content = "<center><table style='color: #b60400; background: black; width: 400px; border: 1px solid #b60400;'><tr><td><br><br>
          Too bad you got nothing...</td></tr></table></center>";
    
          } 
      }
    }
    
    

     

    Thank you so much for reading this thread, I appreciate it a lot.

     

    [attachment deleted by admin]

×
×
  • 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.