Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About cliftonbazaar

  • Rank
    Advanced Member

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    Adelaide Hills
  1. Then wouldn't stripping the quotation marks also stop the injection attack? At the moment it only happens when there are quotation marks around their middle name, this is pulled information from a third party site so I can't stop it on their end.
  2. I have the following code $sql_statement = "SELECT * FROM toon WHERE ally_code = '".$user['ally_code']."' and name = '".$toons_array[$i][1]."' LIMIT 1"; Which works except if the persons 'name' has quotation marks in it, for example the name of Adam "Danger" Smith doesn't match with Adam Danger Smith. My best attempt was $sql_statement = "SELECT * FROM toon WHERE ally_code = '".$user['ally_code']."' and trim( both '"' from name) = '".$toons_array[$i][1]."' LIMIT 1"; Any suggestions please?
  3. Thanks for the explanation and the better way of doing it
  4. From what I have read decbin has an upper limit of 2 to the power of 52, so what is going wrong with this code? function teams($number){ $number = decbin($number); //Change the number to Binary if($number % 10) {echo " <font color=green>ARENA</font> ";} //1 if($number / 10 % 10) {echo " <font color=maroon>FLEET</font> ";} //2 if($number / 100 % 10) {echo " <font color=yellow>FLEET RESERVE</font>";} //4 if($number / 1000 % 10) {echo " <font color=gold>FLEET COMMANDER</font>";} //8 if($number / 10000 % 10) {echo " &l
  5. Thanks Benanamen, that's excactly what I'm after. This code is working out ratings based on what is in the database, so all the data has been stored, I now have to work out the results. This is part of a much bigger project so I need to be able to integrate the data with other parts which this array has done.
  6. I have an array of $my_heroes = ("Batman", "Superman", "Spiderman", "Hulk"); Note that this array will expand over time as more 'Heroes' are added. Each Hero is to have a value added, depending on several things, and then sorted at the end. My thinking is to have a 2 Dimensional array. So my question is how do I change my array into a 2D array and then add a value, so for example after round one of fighting I wish to give Batman 10 points, Superman 15 points and Hulk 20 points. I have tried $$my_heroes[0] += 10; but this turned out to be a disaster. So the end result I w
  7. Currently my code is $sql_statement="UPDATE players SET cls = '".$_GET['cls']."', rjt = '".$_GET['rjt']."', thrawn = '".$_GET['thrawn']."', rolo = '".$_GET['rolo']."', ipd = '".$_GET['ipd']."', arena1 = '".$_GET['arena1']."', arena2 = '".$_GET['arena2']."', arena3 = '".$_GET['arena3']."', arena4 = '".$_GET['arena4']."', arena5 = '".$_GET['arena5']."', fleet1 = '".$_GET['fleet1']."', fleet2 = '".$_GET['fleet2']."', fleet3 = '".$_GET['fleet3']."', fleet4 = '".$_GET['fleet4']."', fleet5 = '".$_GET['fleet5']."' WHERE ally_code = '".$_SESSION['ally_code']."'"; Each GET is t
  8. Hi, If my table is Batman Human 45 Superman Alien 33 How do I display Superman's race and age? Currently I have $sql_statement = "SELECT * FROM heroes"; $toons=mysqli_query($mysql_DB, $sql_statement); while($toons = mysqli_fetch_array($results, MYSQLI_ASSOC)) { echo name; } But this shows all the results where I only want one. Yes I know I could do a "WHERE name = Superman" in the statement but I want the whole table loaded in as I wish to use the other name (Batman) in another part of the program. Please note that this is only a sample data table, the real table is a l
  9. Sorry to have to bump but I cannot work out how to display the answers; I can do the JOIN but not display the answers how I need
  10. JOIN is easy if they were the only toons in the database but they are not, in fact they can be out of order for some players
  11. So I have two tables (one small, one large), the first table is called 'profile' and has each players name, the second table is called 'toon' and has each players characters. What I am trying to do is output the players (which is easy to do with mysqli_fetch_array) but I also wish to output some of the players toons with their power level. table 'profile' 1 James 2 Darren table 'toons' 1 Batman 456 1 Superman 789 2 Batman 1245 2 Superman 564 The output I want is NAME BATMAN SUPERMAN James 456 789 Darren 1245 564 Obviously this is a simplication of what I a
  • 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.