Error in sql code
asund - January 8, 2009 - 13:50
| Project: | CDN2 Video |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | kylebrowning |
| Status: | closed |
Jump to:
Description
I get the following error in watchdog when uploading video, and the video is not put into the cck field when returned:
Unknown column 'field_cdn2_video_token' in 'where clause' query: SELECT nid FROM content_type_profile WHERE field_cdn2_video_token = '[my token]#039; in /[my site]/sites/all/modules/cdn2/cdn2.module on line 539.
There seem to be something wrong with the sql coding. It includes the '' signs in the sql command.
If i change (on line 538)
$query = "SELECT nid FROM {%s} WHERE %s = '%s'";
$result = db_query($query, 'content_type_'. $content_type, "field_cdn2_video_token", $video_token);to
$query = "SELECT nid FROM {%s} WHERE %s = %s";
$result = db_query($query, 'content_type_'. $content_type, "field_cdn2_video_token", $video_token);The video gets stored in cck when returned from encoding - but i still get some error messages, so i guess there's more to it than that.

#1
The error message didn't print right above - this is what it looks like.
Unknown column & #039;field_cdn2_video_token' in & #039;where clause& #039; query: SELECT nid FROM content_type_rays WHERE field_cdn2_video_token = 0c7afb69-dd88-11dd-ab14-cbe5b0cc8c64 in /home/sites/all/modules/cdn2/cdn2.module on line 539.(I put spaces after the &'s so you'd see them.)
#2
Acknowledged
#3
i seemed to have fixed this in drupal6, if you continue to get this error message, let me know.
#4
Automatically closed -- issue fixed for 2 weeks with no activity.
#5
I am having this issue in cdn2 module 6.x-1.9 version.
I am using cck version 6.x-2.5
When I change the query to bellow line it worked for me.
$query = "SELECT nid FROM {%s} WHERE %s = '%s'";$result = db_query($query, $field_info['table'], $field_info['field_name'].'_video_token', $video_token);
#6
#7
Automatically closed -- issue fixed for 2 weeks with no activity.