Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whitespace throws warning during conversion #24

Open
cudencuden opened this issue Feb 11, 2017 · 5 comments
Open

Whitespace throws warning during conversion #24

cudencuden opened this issue Feb 11, 2017 · 5 comments

Comments

@cudencuden
Copy link

cudencuden commented Feb 11, 2017

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

@philip
Copy link
Owner

philip commented Feb 12, 2017

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()?

@cudencuden
Copy link
Author

cudencuden commented Feb 12, 2017

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

@philip
Copy link
Owner

philip commented Feb 12, 2017

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 :)

@cudencuden
Copy link
Author

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

@cudencuden cudencuden changed the title SUM() in query throws warning Whitespace throws warning during coversion Feb 12, 2017
@philip
Copy link
Owner

philip commented Feb 13, 2017

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

@philip philip reopened this Feb 13, 2017
@cudencuden cudencuden changed the title Whitespace throws warning during coversion Whitespace throws warning during conversion Feb 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants