-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
[SOLVED] Information is not displaying can't see why!
MadTechie replied to jigsawsoul's topic in PHP Coding Help
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 -
Have script that I would like to run continuously.
MadTechie replied to flexxall's topic in Javascript Help
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 -
[SOLVED] Information is not displaying can't see why!
MadTechie replied to jigsawsoul's topic in PHP Coding Help
Change <?=$tablerows?> to <?php echo $tablerows; ?> if it works do the same for $message -
Need help looping thru an array and exctracting something
MadTechie replied to Webgirl's topic in PHP Coding Help
Sounds like homework! -
Have script that I would like to run continuously.
MadTechie replied to flexxall's topic in Javascript Help
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 -
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)
-
Have script that I would like to run continuously.
MadTechie replied to flexxall's topic in Javascript Help
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> -
Strange, (moving to SQL section) Any weird characters ? what about trying action LIKE '%nothing%here%'
-
Have script that I would like to run continuously.
MadTechie replied to flexxall's topic in Javascript Help
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> -
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
-
Have script that I would like to run continuously.
MadTechie replied to flexxall's topic in Javascript Help
What do you mean by run continuously I don't think you mean this while(true) { /*No comment*/ } -
maybe add a sleep(15), or reduce the 500 to 100
-
$Chunks = ceil(count($all_players_data / $MaxChunk)); should be $Chunks = ceil(count($all_players_data)/ $MaxChunk);
-
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()); } } ?>
-
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]));
-
Just read the sql_safe function and was going to say that
-
$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' ";
-
EDIT: ignore this post $player_name = sql_safe($player_data[13]);
-
$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' ";
-
echo the query to check it
-
POSTING the exact same post more than once is against the rules Forum Rules
-
$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);
-
Well the database has the quotes in, so striping them out vii stripslashes will make the answer invalid
-
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
-
do a var_dump($_SESSION['get']); and see what you get