Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Webmasters Area (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=14)
-   -   Stumped (http://www.mysidiaadoptables.com/forum/showthread.php?t=1192)

Fireballchad 11-30-2009 04:35 AM

Stumped
 
lol Right now I am trying to figure out how to do something... but either my server is stupid and keeps breaking or I am way to tired... I think its both.
PHP Code:

// I cant get it to this for some reason
$newclicks $totalclicks $bonus

Its normaly + 1 but it will not accept $bonus for some reason its bugging me... I have the var set correctly from the data base it will show up in the page when i call it but it wont do the clicks :( and earlier i had two $thingone + $thingtwo = $thingthree they where working but they died also...

Arianna 11-30-2009 09:10 AM

RE: Stumped
 
Really? I have code which runs with this:
PHP Code:

            $newbalance $money $wordcount

From what I see in your code, it should work. Have you made sure that $bonus is being declared?

exdiogene 11-30-2009 12:57 PM

RE: Stumped
 
above it just put
PHP Code:

$bonus 1


Arianna 11-30-2009 01:00 PM

RE: Stumped
 
Or whatever the bonus is equal to. ;)

Fireballchad 11-30-2009 05:36 PM

RE: Stumped
 
Quote:

Originally Posted by tommyk1210
above it just put
PHP Code:

$bonus 1


I was attempting to ad a feature where you buy and item and it gives you an extra click bonus... I had $bonus become the correct number while querying it from the data base, but it broke the clicks for some reason. When someone clicks it said you did it and logs it but it does not give you the clicks it gives you 0.

Arianna 12-01-2009 12:11 AM

RE: Stumped
 
Make sure that you're getting $bonus correctly - a few weeks ago, I almost totally restructured a piece of code, and then I noticed that it just wasn't getting the most important variable from the database correctly.

exdiogene 12-01-2009 02:03 AM

RE: Stumped
 
Quote:

Originally Posted by Fireballchad
Quote:

Originally Posted by tommyk1210
above it just put
PHP Code:

$bonus 1


I was attempting to ad a feature where you buy and item and it gives you an extra click bonus... I had $bonus become the correct number while querying it from the data base, but it broke the clicks for some reason. When someone clicks it said you did it and logs it but it does not give you the clicks it gives you 0.

It would be easier to just put $bonus = 1 if that is what it always is. This puts less strain on the sevrer and increases the speed of the script if it doesnt need to query the database. Have you tried it without using the database?

Arianna 12-01-2009 09:10 AM

RE: Stumped
 
However, what if bonus is different? What would be the point of bonus being one? Then it would just be the same as a normal script. :/

exdiogene 12-01-2009 12:08 PM

RE: Stumped
 
Well in all intents and purposes the script should work as he currently has it.

@Fireballchad: May we look at the script? Maybe we can spot an error as the script should work as you described it.

Fireballchad 12-01-2009 02:43 PM

RE: Stumped
 
Quote:

Originally Posted by tommyk1210
Well in all intents and purposes the script should work as he currently has it.

@Fireballchad: May we look at the script? Maybe we can spot an error as the script should work as you described it.

Oh I put it back to normal because I could not get it to work properly.
I will show you what I was attempting to do.
PHP Code:

              $query "SELECT * FROM `adopts_users` WHERE `username`='$loggedinname'";
                  
$result mysql_query($query);
                  
$num mysql_numrows($result);
                  
                  
$i 0;
                  while (
$i 1) {
                      
$bonus = @mysql_result($result$i"bonus");
                      
$i++;
                  }

$newclicks $totalclicks $bonus;// Add 1 click to the current click total of this adoptable...
    

    // Actually insert our click information into the database...

    
$query "UPDATE ".$prefix."owned_adoptables SET totalclicks='$newclicks' WHERE aid='$id'";
    
mysql_query($query); 

***Edit
Hmmm I just changed it on my script to see if it could work... and it worked... I have no clue why it was not working before hand...


All times are GMT -5. The time now is 01:57 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.