d22552000 Posted August 14, 2007 Share Posted August 14, 2007 For some reason... this SQL statement runs infinitely and doenst stop until the script's execution limit, or the mysql socket limit is hit, -,- whichever comes first -,-. This file is the code that calls the sql: <?PHP $n = DYN(manfilt($_POST['n'])); require('C:/Inetpub/wwwroot/VB3.6.7/sql.php'); echo '<br /><br />' . $sql; sql($n); echo '<br /><br /><br /><br /><a href="http://24.86.150.207/' . $p . '/admincp/index.php">Login to AdminCP</a>'; ?> This file IS: sql.php <?PHP function sql($DB) { $g_link = mysql_connect( '127.0.0.1', 'root', '') or die('Could not connect to server.' ); mysql_select_db($DB, $g_link) or die('Could not select database.'); $sql = ' /* ***COMMAND TRUNCATED*** */ '; mysql_query($sql, $g_link) or die('Could not perform SQL.'); mysql_cose($g_link); } ?> The SQL by itself is 3,716 KBytes, and yes I have escape all '. Note that my dyn and manfilt are custom function filters I have made to filter out characters that are not suited for database names. SCRIPT OUTPUT: Fatal error: Maximum execution time of 120 seconds exceeded in C:\Inetpub\wwwroot\VB3.6.7\sql.php on line 3 .. No Tables are Created. I tried splitting the SQL into parts of 1023 kbytes. It is proessing right now.. maybe it might work..? Quote Link to comment https://forums.phpfreaks.com/topic/64765-infinitely-executing-sql/ Share on other sites More sharing options...
uwannadonkey Posted August 14, 2007 Share Posted August 14, 2007 mysql_cose($g_link); isnt that a typo? Quote Link to comment https://forums.phpfreaks.com/topic/64765-infinitely-executing-sql/#findComment-323066 Share on other sites More sharing options...
d22552000 Posted August 14, 2007 Author Share Posted August 14, 2007 lol ya, fixed now, but the script still doesnt work. Quote Link to comment https://forums.phpfreaks.com/topic/64765-infinitely-executing-sql/#findComment-323076 Share on other sites More sharing options...
uwannadonkey Posted August 14, 2007 Share Posted August 14, 2007 echo '<br /><br /><br /><br /><a href="http://24.86.150.207/' . $p . '/admincp/index.php">Login to AdminCP</a>'; $P isnt defined? or am i wrong Quote Link to comment https://forums.phpfreaks.com/topic/64765-infinitely-executing-sql/#findComment-323078 Share on other sites More sharing options...
d22552000 Posted August 14, 2007 Author Share Posted August 14, 2007 LOLOLOL Notice: Undefined variable: sql in C:\Inetpub\wwwroot\vbcreate.php on line 78 is there a maximum size to a variable? fi you wanna se the full output its at http://24.86.150.207/registration/vbcreate.html submit the forum with w/e you want to, the db deletes all the changes after 5 minutes casue I have it set to test mode. Quote Link to comment https://forums.phpfreaks.com/topic/64765-infinitely-executing-sql/#findComment-323081 Share on other sites More sharing options...
btherl Posted August 14, 2007 Share Posted August 14, 2007 The SQL by itself is 3,716 KBytes, and yes I have escape all '. Why is your query 3,716 Kbytes? Quote Link to comment https://forums.phpfreaks.com/topic/64765-infinitely-executing-sql/#findComment-323095 Share on other sites More sharing options...
d22552000 Posted August 14, 2007 Author Share Posted August 14, 2007 Because it is. why is that important? It is an entire database clone, thats why. It is a preinstallation of a forum AND phpnuke. Its my hosting. Created a db for hte user, ads teh script -,-- I treid to use the source command but it didnt work/ Quote Link to comment https://forums.phpfreaks.com/topic/64765-infinitely-executing-sql/#findComment-323097 Share on other sites More sharing options...
hitman6003 Posted August 14, 2007 Share Posted August 14, 2007 3MB is a lot of queries to execute over the network...my house has 6mb down / 512 kb up, with those numbers it takes the server 60 seconds just to get the SQL file from me, then if it is executing the commands on another remote host, that adds additional execution time, plus the time that the DB server takes to execute the commands. Executing the commands can take a long period of time depending on a lot of things...number of indexes vs. number of inserts, etc. There isn't a max size for a single variable, but there is a max size that the script can occupy in memory. Quote Link to comment https://forums.phpfreaks.com/topic/64765-infinitely-executing-sql/#findComment-323121 Share on other sites More sharing options...
keeB Posted August 14, 2007 Share Posted August 14, 2007 Bad design. Consider revising. Quote Link to comment https://forums.phpfreaks.com/topic/64765-infinitely-executing-sql/#findComment-323137 Share on other sites More sharing options...
d22552000 Posted August 14, 2007 Author Share Posted August 14, 2007 I dont know any other way to do it, so im just tyring to get it to work now, i can redesiign it when it works. oh and BTW, as far ase that, the mysql is localhost if you hadnt noticed so I dont ahve send times, but I still ahve the execute times.. ill run the sql file in phpmyadmin and see how long it takes... Should I run the file with timeout(0); and see how long it takes? Quote Link to comment https://forums.phpfreaks.com/topic/64765-infinitely-executing-sql/#findComment-323153 Share on other sites More sharing options...
dbo Posted August 14, 2007 Share Posted August 14, 2007 Others are right, this isn't the best approach. However a quick fix could be to bump up the max file upload size and the max execution time in the PHP ini file. Try doubling them or something to start with. Quote Link to comment https://forums.phpfreaks.com/topic/64765-infinitely-executing-sql/#findComment-323154 Share on other sites More sharing options...
d22552000 Posted August 14, 2007 Author Share Posted August 14, 2007 my max upload size is quite high because I host an upload sserver. im running this script irght now with set_time_limit(0); to see how long it takes... Could not perform SQLa. Mysql Said: " "; <?PHP function sql($DB) { $g_link = mysql_connect( '127.0.0.1', 'root', '') or die('Could not connect to server.' ); mysql_select_db($DB, $g_link) or die('Could not select database.'); $sql = ' SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; --tables --data '; mysql_query($sql, $g_link) or die('Could not perform SQLa.');echo 'End of SQL.'; mysql_close($g_link); } ?> So... whats wrong now? Quote Link to comment https://forums.phpfreaks.com/topic/64765-infinitely-executing-sql/#findComment-323166 Share on other sites More sharing options...
btherl Posted August 14, 2007 Share Posted August 14, 2007 Is the "Mysql Said:" showing you the output of mysql_error()? I don't see it in your code. Quote Link to comment https://forums.phpfreaks.com/topic/64765-infinitely-executing-sql/#findComment-323241 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.