Jump to content

Parse error: syntax error, unexpected ';' in C:\*\*\*\sql.php on line 13218


d22552000

Recommended Posts

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]

Link to comment
Share on other sites

That is why I would have to see the entire command. Since they are lines in your mysql, I can only assume they are supposed to be strings. Those strings contain all kinds of quotations that would end and restart the string. Try to replace all those quotations with \" like you did with the single quotes.

Link to comment
Share on other sites

ok im runnign word crawler now...

 

crawl("SQL.PHP,REPLACE ALL WHERE \" WITH \\");

 

It's replacing... I'll upoad SQL.php if the site lets me upload 3.5mb files -,-.

 

EDIT, replace finished, im running the program now....

 

EDIT, Page is loading... SQL.php is being parsed now...

EDIT, Page Parsing complete, now its inserting the SQL...

 

EDIT, 64912 files copied... Moving on to SQL...

 

Parse error: syntax error, unexpected ';' in C:\Inetpub\wwwroot\VB3.6.7\sql.php on line 13218

 

CURRENT SOURCE:

 

PHP FILE WITHOUT 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 = "
";

mysql_query($sql, $g_link) or die('Could not perform SQL.' . mysql_error();echo 'End of SQL.';

mysql_close($g_link);
}

?>

 

the full file can be found here:

http://24.86.150.207/sql.php.txt

 

The file is: 5,971 KBytes.

 

oh and to the quotes, it was BY HAND!!

I tried the file with double quotes now, escaping all $ and "... and I still got the same error.

Link to comment
Share on other sites

Since you have one command executing that is over thirteen thousand lines, there is quite a bit of code someone would have to look through to find the syntax error. I am pretty sure what is happening is that there is a quotation mark that is closing the $sql string right in the middle.

 

I would suggest using a program like Dreamweaver or Microsoft Word that allows you to search for a string and replace all occurances with another string. Use this feature to replace all occurances of """ with "\"". As long as you do that, there shouldn't be any php errors, cross your fingers for the sql part, though.

Link to comment
Share on other sites

that IS what I did, but for some reason it doesnt expect a ; somehwere near the end -,-.

 

Uh... so... I wish there was another way to insert the sql, but I can't link sql files like you would a css file -,-,-,-,-.

 

I originally did, uh.. fopen then fputs all the sql to a variable, but that had huge buffer problems, so I did this.

 

IF YOU HAVE ANOTHER WAY PLEASE TELL ME.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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