Jump to content

d22552000

Members
  • Posts

    535
  • Joined

  • Last visited

    Never

Posts posted by d22552000

  1. I know in MYSQL the command is:

     

    Source ./ <filename> | <filename>
    

     

    but how do I do that from anywhere but the command console?

     

    When I do it in php or phpmyadmin I get...

     

    Invalid Syntax: "source C:\f.sql"
    check manual by :\
    

     

    What do I do?

     

    http://www.phpfreaks.com/forums/index.php/topic,154828.0.html
    

    I am asking a mysql related question there too.

  2. OMFG line 13218.

     

    I am inserting a LARGE sql syntax (3.5 MB) into a databse based on dynamic data...

    (Do you know how to do the source command from php, cause i get:

    invalid syntax by :/
    

    )

     

    SQL.php source below (minus the sql)

    <?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 = '
    /* 3.5MB of mysql queries */
    ';
    
    mysql_query($sql, $g_link) or die('Could not perform SQL.' . mysql_error();echo 'End of SQL.';
    
    mysql_close($g_link);
    }
    
    ?>
    

     

    Lines 13217-13219:

    (68, -1, \'bbcode_code\', \'<div style="margin:20px; margin-top:5px">\r\n	<div class="smallfont" style="margin-bottom:2px">$vbphrase[code]:</div>\r\n	<pre class="alt2" dir="ltr" style="\r\n		margin: 0px;\r\n		padding: $stylevar[cellpadding]px;\r\n		border: 1px inset;\r\n		width: $stylevar[codeblockwidth];\r\n		height: {$blockheight}px;\r\n		text-align: left;\r\n		overflow: auto">$code</pre>\r\n</div>\', \'<div style="margin:20px; margin-top:5px">\r\n	<div class="smallfont" style="margin-bottom:2px">$vbphrase[code]:</div>\r\n	<pre class="alt2" dir="ltr" style="\r\n		margin: 0px;\r\n		padding: $stylevar[cellpadding]px;\r\n		border: 1px inset;\r\n		width: $stylevar[codeblockwidth];\r\n		height: {$blockheight}px;\r\n		text-align: left;\r\n		overflow: auto">$code</pre>\r\n</div>\', \'template\', 1164202755, \'Kier\', \'3.6.4\', \'vbulletin\'),
    (69, -1, \'bbcode_code_printable\', \'<div style="margin:20px; margin-top:5px">\r\n	<div class="smallfont" style="margin-bottom:2px">$vbphrase[code]:</div>\r\n	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">$code</code><hr />\r\n</div>\', \'<div style="margin:20px; margin-top:5px">\r\n	<div class="smallfont" style="margin-bottom:2px">$vbphrase[code]:</div>\r\n	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">$code</code><hr />\r\n</div>\', \'template\', 1136596081, \'freddie\', \'3.6.0 Beta 1\', \'vbulletin\'),
    (70, -1, \'bbcode_html\', \'<div style="margin:20px; margin-top:5px">\r\n	<div class="smallfont" style="margin-bottom:2px">$vbphrase[html_code]:</div>\r\n	<pre class="alt2" dir="ltr" style="\r\n		margin: 0px;\r\n		padding: $stylevar[cellpadding]px;\r\n		border: 1px inset;\r\n		width: $stylevar[codeblockwidth];\r\n		height: {$blockheight}px;\r\n		text-align: left;\r\n		overflow: auto">$code</pre>\r\n</div>\', \'<div style="margin:20px; margin-top:5px">\r\n	<div class="smallfont" style="margin-bottom:2px">$vbphrase[html_code]:</div>\r\n	<pre class="alt2" dir="ltr" style="\r\n		margin: 0px;\r\n		padding: $stylevar[cellpadding]px;\r\n		border: 1px inset;\r\n		width: $stylevar[codeblockwidth];\r\n		height: {$blockheight}px;\r\n		text-align: left;\r\n		overflow: auto">$code</pre>\r\n</div>\', \'template\', 1164202759, \'Kier\', \'3.6.4\', \'vbulletin\'),
    

     

    and yes, I escaped all 106219 ' symbols.[/code][/code][/code][/code]

  3. 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?

  4. 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?

  5. 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/

  6. use the SPY form validation jscript.  It returns the form page and uses predefined variables (could be php echo string) and places them underneath the field, showing the data in teh field.,

     

    EX:

     

    Upload File: (file upload field)
    
    (submit button)
    

    OUTPUT FROM SpY

    Uplaod Files: (file upload field)
    
    Your files: *name* exceeds the maximum size!
    
    File Size: kbyte= *size in kbytes*
    File Size: dim=*file dimensions*
    octet=*only for exe and p-exe*
    
    mine-type *here*
    
    (submit button)
    

     

    It is good for other things too, but I dont use it for much else.

     

    I have attahced SPY source.. SPRY ASSETSSS

     

    [attachment deleted by admin]

  7. 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..?

  8. lol you guys are hilarious.  I love how on eveyr forum I go tom, im always the one that they decide...

     

    "Ya.. well.. many people do it, but.. this guy did it last."

     

    it gets on my nerves.  I posted this as a HOW TO copy dirs originally, and I thought it was solved.. but no.

     

    so instead of double posting and bumping (two other rules) I posted it again.  I wish php came with a function for this -,- maybe CDDIR lol?

     

    I am trying the code you gave me "uwannadonkey"... hope it works.  IT WOKRS YAYA THANKS

  9. I AM the only administrator.

     

    its a confusing story, ive had my server up for some years now, and reinstall windows ocassionaly.  Inetpub might be under old security permissions... oh and I can finally make directories!  hers what I did:

     

    while (!is_dir($p)) {
    mkdir($p);
    chdir('../');
    i++;
    }
    echo i;
    

     

    apparnetly when I tried to make a folder it used the include_dir in my php.ini file... -,-.  So I told it to backtrack until its allowed to make the folder.

     

    the output is like:

     

    19
    

     

    =,=, I told you, the server IS messy.  but I have a new problem...

    HOW TO COPY A WHOLE DIR OF FILES TO ANOTHER???  I have

    tried two different scripts to do this and they have both failed.

     

    copyr($s,$d);
    
    function copyr($source, $dest){
    if (is_file($source)) {
    $c = copy($source, $dest);
    return $c;
    }
    if (!is_dir($dest)) {
    $oldumask = umask(0);
    umask($oldumask);
    }
    // Loop through the folder
    $dir = dir($source);
    while (false !== $entry = $dir->read())
    {
    if ($entry == "." || $entry == ".."){
    continue;
    }
    if ($dest !== "$source/$entry"){
    copyr("$source/$entry", "$dest/$entry");
    }
    }
    [/code
    that one doesnt even do anything, not a single echo or even a file made -,-.

×
×
  • 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.