Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. okay add $result = mysql_query ($result) or die (mysql_error()); $found = mysql_num_rows ($result); //ADD $tablerows = "FOUND: $found"; //ADD while($row = mysql_fetch_assoc($result)) If you get FOUND: 0 then the query is the problem
  2. If you image is in the wrong place then check the class as the first class was called cornerimage0 i assumed the next one would be cornerimage1 so i did <img id="dymImg0" class="cornerimage0" src="./images/random0.php"/> <img id="dymImg1" class="cornerimage1" src="./images/random1.php"/> in my last example
  3. Change <?=$tablerows?> to <?php echo $tablerows; ?> if it works do the same for $message
  4. I know you could write this a better way but this should work <img id="dymImg0" class="cornerimage0" src="./images/random0.php"/> <img id="dymImg1" class="cornerimage1" src="./images/random1.php"/> <!-- ADD --> <script> var dymImg= new Array(); var imgBase= new Array(); imgBase[0] = "./images/random0.php?"; imgBase[1] = "./images/random1.php?"; //ADD var c = 0; function count() { c++; T=imgBase.length; for(n=0;n<t;n++) { dymImg[n].src=imgBase[n]+c; } } function init() { dymImg[0]= document.getElementById("dymImg0"); dymImg[1]= document.getElementById("dymImg1"); //ADD setInterval("count()",1000); } window.onload = init; </script> if it works then add the rest to the 3 add points
  5. add foreach($chunk_all_players_data as $chunk_players_data) { sleep(5); //ADD this will pause the script for 5 seconds (giving MySQL a rest)
  6. try this (only a slight change) <img id="dymImg" class="cornerimage0" src="./images/random0.php?"/> <script> var dymImg; var imgBase="./images/random0.php?" var c = 0; function count() { c++; dymImg.src=imgBase+c; } function init() { dymImg= document.getElementById("dymImg"); if( dymImg) { setInterval("count()",1000); } } window.onload = init; </script>
  7. Strange, (moving to SQL section) Any weird characters ? what about trying action LIKE '%nothing%here%'
  8. Moving to JavaScript section, Its not really an AJAX issue as the server doesn't need to poll a query.. just refresh the image I assume its just this line that needs to be refresh <img class="cornerimage0" src="./images/random0.php"/> update to <img id="dymImg" class="cornerimage0" src="./images/random0.php"/> and add this script <script> var dymImg; var imgBase="./images/random0.php?" var c = 0; function count() { dymImg.src=imgBase+(++c); } function init() { dymImg= document.getElementById("dymImg"); if( dymImg) { setInterval("count()",1000); } } window.onload = init; </script>
  9. Could you post some samples of what you have tried and what's in the database, for example is "nothing here" in the database ? if you have something like in the database and you want to find entries that that "nothing" and "here" then you could use LIKE SELECT * FROM test WHERE action LIKE '%nothing%' AND action LIKE '%here%' ORDER BY id or for fulltext searches SELECT * FROM test WHERE MATCH(action) AGAINST('nothing','here')ORDER BY id
  10. What do you mean by run continuously I don't think you mean this while(true) { /*No comment*/ }
  11. maybe add a sleep(15), or reduce the 500 to 100
  12. $Chunks = ceil(count($all_players_data / $MaxChunk)); should be $Chunks = ceil(count($all_players_data)/ $MaxChunk);
  13. you could create another loop to break it into smaller chunks here's a basic example <?php // split every 20 lines into a new array $all_players_data = array_chunk($players_data_file, 20); //Calculate Number of chuncks $MaxChunk = 500; $Chunks = ceil(count($all_players_data / $MaxChunk)); //Break into chunks $chunk_all_players_data = array_chunk($all_players_data, $Chunks, true); //Loop through each chunk foreach($chunk_all_players_data as $chunk_players_data) { // loop through each block of 20 lines foreach($chunk_players_data as $player_data) //UPDATED { //.....SNIP mysql_query($sql) or die('Cannot inset/update table!'.mysql_error()); } } ?>
  14. put the sql_safe in the sql_safe function change function sql_safe($value) { $value = trim($value); if(is_numeric($value)) return $value; else return "'$value'"; } to function sql_safe($value) { $value = trim($value); if(is_numeric($value)) return $value; else return "'".addslashes($value)."'"; } and remove the one you added back to $player_name = sql_safe($player_data[13]); OR JUST do $player_name = sql_safe(addslashes($player_data[13]));
  15. Just read the sql_safe function and was going to say that
  16. $user_exists_sql = "SELECT `name` FROM `'.$player_table_name.'` WHERE `name`=$player_name"; single quotes (wrong way around)? $user_exists_sql = "SELECT `name` FROM `$player_table_name` WHERE `name`='$player_name' ";
  17. EDIT: ignore this post $player_name = sql_safe($player_data[13]);
  18. $user_exists_sql = "SELECT `name` FROM `'.$player_table_name.'` WHERE `name`=$player_name"; should be $user_exists_sql = "SELECT `name` FROM `$player_table_name` WHERE `name`='$player_name' ";
  19. echo the query to check it
  20. POSTING the exact same post more than once is against the rules Forum Rules
  21. $SQL = sprintf("SELECT * FROM $table WHERE $table.video_id='%s' ORDER BY id ASC",mysql_real_escape_string($_SESSION['get'])); $display = mysql_query($SQL,$db)or trigger_error("Query failed: " . mysql_error() . PHP_EOL); //------- $myanswer = htmlentities($_POST[$q], ENT_QUOTES);
  22. Well the database has the quotes in, so striping them out vii stripslashes will make the answer invalid
  23. Sorry read the question wrong, though you wanted allow_url_fopen Off and wanted include allow_url_include will stop just include and require as a note: if allow_url_include is ON it will fail unless allow_url_fopen is also ON
  24. do a var_dump($_SESSION['get']); and see what you get
×
×
  • 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.