MySQLConverterTool icon indicating copy to clipboard operation
MySQLConverterTool copied to clipboard

Whitespace throws warning during conversion

Open cudencuden opened this issue 8 years ago • 5 comments

$result = SQL_Query_exec("SELECT SUM(downloaded) AS totaldl FROM users"); 
while ($row = mysql_fetch_array ($result)) { 
	$totaldownloaded = $row["totaldl"]; 
} 

edit: Solved, it is just the space between mysql_fetch_array and ($result)

I noticed that for every pattern of SUM above i get: Please check your code for parse errors, we failed to parse " ". Conversion will be incomplete!". The warning referenced line is at WHILE, but I am thinking the SUM() is throwing the error. any help?

cudencuden avatar Feb 11 '17 19:02 cudencuden

Thanks, I'll check next week, but wonder if it might relate to mixing user defined and native functions like that. Do you see the same error when using mysql_query()?

philip avatar Feb 12 '17 19:02 philip

you are correct, i do not see same warning when using mysql_query(). the user defined calls mysql_query and insert any caught error into a table

cudencuden avatar Feb 12 '17 19:02 cudencuden

Interesting. I'm only able to do a little testing now, but also found a way to make your code work. Removing the space from mysql_fetch_array ( somehow converts fine, so this works:

$result = SQL_Query_exec("SELECT SUM(downloaded) AS totaldl FROM users"); 
while ($row = mysql_fetch_array($result)) { 
	$totaldownloaded = $row["totaldl"]; 
}

I'm not yet sure why this is the case as whitespace shouldn't interfere here. Perhaps while testing mysql_query() you also happened to remove that space? Or maybe there are multiple issues going on here. Ugh.

Also, it appears the conversion works fine despite this bogus warning, so at least there's that :)

philip avatar Feb 12 '17 21:02 philip

yes, it is just the space between mysql_fetch_array and ( . thank you.

cudencuden avatar Feb 12 '17 22:02 cudencuden

This shouldn't be a problem, let's reopen this.

philip avatar Feb 13 '17 02:02 philip