Hi, I just upgraded to 2.2 and am getting the following error when I try to upload a file:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM content_ WHERE vid = 0 LIMIT 0, 1' at line 1 query: SELECT FROM content_ WHERE vid = 0 LIMIT 0, 1 in /var/www/html/esage/dpl1/includes/database.mysqli.inc on line 151.

Please advise.

CommentFileSizeAuthor
#4 backtrace_1.txt20.37 KBmtndan

Comments

jpetso’s picture

Status: Active » Closed (duplicate)

I notice a slight similarity to this recent issue. Any chance that the file you want to upload is large, and probably larger than your 'post_max_size' PHP setting? Sounds like a duplicate to me.

mtndan’s picture

Unfortunately I don't think that's the prob. The file is just 1 mb, and my post max is set to 20M

jpetso’s picture

Status: Closed (duplicate) » Postponed (maintainer needs more info)

Well then you need to track it down for me. In particular, I would be interested in what the $_POST variable contains when filefield_js() is called, and if it's not empty, I need a backtrace (which is easy to do with Devel module).

mtndan’s picture

StatusFileSize
new20.37 KB

Here's the backtrace attached - I'm not sure how to get the other info you requested - can you let me know? Thanks

mtndan’s picture

Hi, just wondering if anyone can help with this. Thanks in advance.

jpetso’s picture

Oh right, sorry. What you could do is insert this line:

drupal_set_message('<pre>POST: '. print_r($_POST, TRUE) .'</pre>');

as first line of the filefield_js() function (at the bottom of filefield.module), and try to upload a file that doesn't work as described.
That should hopefully produce some meaningful output and tell why uploading didn't work out.

vascopedro’s picture

I have the same issue, when uploading a file I get

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM content_ WHERE vid = 0 LIMIT 0, 1' at line 1 query: SELECT FROM content_ WHERE vid = 0 LIMIT 0, 1 in /home/papsonli/public_html/includes/database.mysql.inc on line 172.

I am trying to upload a txt file with 1k size, so it's not the size limit. I have double checked the permissions on user uploading files. I have searched for hours and I just can't figure it out.

Please HELP!!!!

Cheers,

Vasco

vm’s picture

did you do what comment #6 asks of someone having this error ? doing so will help diagnose the problem so it can be fixed

vascopedro’s picture

I got this when looking at a page that uses the module:

Parse error: parse error, unexpected '<' in /home/papsonli/public_html/modules/filefield/filefield/filefield.module on line 793

I don't have the devel module installed, I looked at it and there is a note that it might brake everything, is it needed?

Sorry, drupal newbie.

Vasco

vascopedro’s picture

Got it! previously was just some dumb error, here is the result

POST: Array
(
[user_cv_node_form] => Array
(
[cck_filefield_field_usercv_op] => Upload
[nid] =>
[vid] =>
[type] => user_cv
[changed] =>
[field_usercv-attach-url] => http://papsonline.org/?q=filefield/js
[log] =>
[menu] => Array
(
[title] =>
[description] =>
[pid] => 1
[path] =>
[weight] => 0
[mid] => 0
[type] => 86
)

[comment] => 0
[status] => 1
)

[form_token] => 3d568a5a78455e651f19eb714b0c161d
[form_id] => user_edit
)

Does this help?

Vasco

jpetso’s picture

Thank you, this is great! Of course, it doesn't really help to find out *why* the node (including the especially important "nid") is not in the $_POST variable, but it does help writing a workaround for getting rid of at least those ugly error messages. If anyone finds out why the nid is not passed, I'd be forever grateful.

vascopedro’s picture

I don't know if it helps, but I can upload fine if go to create content -> resume, but if I go to My Account -> create Resume, I get the error. I hope it helps, I could really use this module.

Thanks,

Vasco

gladideg’s picture

I have the same issue. On the sixth file I try to upload, the total size of the node goes from 29mb to 34mb. Then this error occurs and files are deleted.

SUbscribing.

dopry’s picture

Are there any errors in your webserver logs or watchdog after these upload issue. This has failed ajax upload post written all over it... What modules do you have enabled on the sites? what is you post_max_size and max_upload_size set to?

ohnemax’s picture

I had the same issue, it donesn't come up anymore after changing both post_max_size and max_upload_size to 24M (at least bigger than the biggest file I wanted to upload...)

dopry’s picture

Does this happen if you use the 5.x-2.x dev release?

dopry’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

close for inactivity... and this is a support request.. It works fine with a properly configured web server... Check you php.ini for post_max_size and max_upload_size.

avoine’s picture

We have the same problem here we are not able to upload with filefield and normal drupal upload and we have:

php version 5.2.0-8+etch11
drupal 5.10
File Field 5.x-2.3
JQuery Update 5.x-1.0

and the upload work fine with the javascript off

huizache’s picture

Status: Closed (fixed) » Active
dopry’s picture

Status: Active » Closed (fixed)

@all: do not reopen closed issues. open your own issue describing your problem.