Two Variables within Else if menu

Shout-Out

User Tag List

Results 1 to 10 of 10
  1. #1
    DoxramosPS's Avatar Knight
    Reputation
    26
    Join Date
    Aug 2010
    Posts
    214
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Two Variables within Else if

    So I'm trying to get my else if function to work correctly using two values pulled from the SQL database.
    Code:
    if ($fontcolor=<$row['vote_points'])
    {
    echo '<font color="green">';
    }
    else
    {
    echo '<font color="red">';
    }
    But when I do this I get the result that there is an unexpected < at <$row['vote_points'].
    I'm fairly sure this is due to incorrect formatting using variables, however I do know that the variables pull the correct information from the database.
    Hoping someone's sitting there laughing going "Nab!" but is still willing to help. Thank you.
    Mangos and Trinity Emulation
    Windows | Linux
    Under Development : morgangreen.org WoW CMS Site

    Two Variables within Else if
  2. #2
    ev0's Avatar ★ Elder ★ murlocs.com

    CoreCoins Purchaser Authenticator enabled
    Reputation
    1852
    Join Date
    Jul 2012
    Posts
    2,735
    Thanks G/R
    313/379
    Trade Feedback
    16 (100%)
    Mentioned
    7 Post(s)
    Tagged
    7 Thread(s)
    Originally Posted by DoxramosPS View Post
    So I'm trying to get my else if function to work correctly using two values pulled from the SQL database.
    Code:
    if ($fontcolor=<$row['vote_points'])
    {
    echo '<font color="green">';
    }
    else
    {
    echo '<font color="red">';
    }
    But when I do this I get the result that there is an unexpected < at <$row['vote_points'].
    I'm fairly sure this is due to incorrect formatting using variables, however I do know that the variables pull the correct information from the database.
    Hoping someone's sitting there laughing going "Nab!" but is still willing to help. Thank you.
    PHP Code:

    if($row['vote_points'] >= "put a # value here"){

    echo 
    "green shit";
    }elseif(
    $blah <= "number shit"){
    echo 
    "red shit";

    Need a guild in the US? Visit murlocs.com

  3. #3
    DoxramosPS's Avatar Knight
    Reputation
    26
    Join Date
    Aug 2010
    Posts
    214
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm. So no way to make both parts of the if else statement pull from the database from two seperate tables huh? =/
    EG.
    There's something for 20 VP, but also another thing for 10. I wouldn't want to make the red show up if the guy had 15 and he was looking at the one that cost 10, but he would get the red if it was the 20 vp one. If that makes sense at all.
    Side note. Saw the link with the tattoo. Awesome!
    Last edited by DoxramosPS; 02-25-2013 at 09:13 PM.
    Mangos and Trinity Emulation
    Windows | Linux
    Under Development : morgangreen.org WoW CMS Site

  4. #4
    ev0's Avatar ★ Elder ★ murlocs.com

    CoreCoins Purchaser Authenticator enabled
    Reputation
    1852
    Join Date
    Jul 2012
    Posts
    2,735
    Thanks G/R
    313/379
    Trade Feedback
    16 (100%)
    Mentioned
    7 Post(s)
    Tagged
    7 Thread(s)
    you could build a function for it? maybe idk. not 100% sure what you're trying to do.

    and thanks for the tattoo compliment
    Need a guild in the US? Visit murlocs.com

  5. #5
    DoxramosPS's Avatar Knight
    Reputation
    26
    Join Date
    Aug 2010
    Posts
    214
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $con mysql_connect($serveraddress,$serveruser,$serverpass);
    mysql_select_db("website",$con);  
    $get_chars mysql_query("SELECT * FROM users WHERE id = '".$account_information['id']."'");
    while(
    $font mysql_fetch_array($get_chars))
    {
    $fontcolor $font['vote_points'];
    echo 
    $fontcolor;
    }
      if (
    $fontcolor="10")
      {
      echo 
    '<font color="green">';
      }
      else
      {
      echo 
    '<font color="red">';
      }
      echo 
    "<td>" $row['price'] . " Vote Points</td>";

      echo 
    "</tr>";
      }
    echo 
    "</table>"
    That's more now just to test the font color change and that's not even taking into place. I've echoed the values to enure they're read correctly and they are, so I don't know what's going on.
    Mangos and Trinity Emulation
    Windows | Linux
    Under Development : morgangreen.org WoW CMS Site

  6. #6
    DoxramosPS's Avatar Knight
    Reputation
    26
    Join Date
    Aug 2010
    Posts
    214
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Essentially if the user's points don't add up to the total I want it to have the Vote Points on the bottom as red. If they have enough I want it to display as green.
    And n/p; thought it was pretty awesome.
    Mangos and Trinity Emulation
    Windows | Linux
    Under Development : morgangreen.org WoW CMS Site

  7. #7
    ev0's Avatar ★ Elder ★ murlocs.com

    CoreCoins Purchaser Authenticator enabled
    Reputation
    1852
    Join Date
    Jul 2012
    Posts
    2,735
    Thanks G/R
    313/379
    Trade Feedback
    16 (100%)
    Mentioned
    7 Post(s)
    Tagged
    7 Thread(s)
    just do a


    if something

    elseif something

    else blah end
    Need a guild in the US? Visit murlocs.com

  8. #8
    DoxramosPS's Avatar Knight
    Reputation
    26
    Join Date
    Aug 2010
    Posts
    214
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm. Suppose I could just have each type in a different section. 10 points, 20 points etc etc. And just declare the points manually.
    Mangos and Trinity Emulation
    Windows | Linux
    Under Development : morgangreen.org WoW CMS Site

  9. #9
    DoxramosPS's Avatar Knight
    Reputation
    26
    Join Date
    Aug 2010
    Posts
    214
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If it would help to see what I'm working on at all you can see it at doxramos.org/pets.php
    Mangos and Trinity Emulation
    Windows | Linux
    Under Development : morgangreen.org WoW CMS Site

  10. #10
    morph34b's Avatar Private
    Reputation
    1
    Join Date
    Apr 2013
    Posts
    2
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hello, its good information
    six months industrial training in chandigarh

Similar Threads

  1. Replies: 4
    Last Post: 07-16-2016, 01:02 PM
  2. Good way: within two seconds to enter Karazhan tomb
    By Panda9199 in forum World of Warcraft Exploration
    Replies: 6
    Last Post: 11-01-2015, 12:55 PM
  3. Two heroism within the first few mins of an RBG match
    By Thepro27 in forum World of Warcraft Exploits
    Replies: 9
    Last Post: 11-22-2012, 09:21 PM
  4. Any hack for two-on-one accounts ?
    By insolencation in forum World of Warcraft General
    Replies: 11
    Last Post: 07-12-2006, 01:44 AM
  5. Hate MySpace? Put this in someone elses comment
    By Matt in forum Community Chat
    Replies: 1
    Last Post: 04-23-2006, 03:47 PM
All times are GMT -5. The time now is 11:00 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search