I got the error message when creating a playlist node.
Thanks for your help!

drupal 4.7.2
playlist module 4.7.0 (06/29)
mysql 4.1
php 5.0

ERROR message:
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 '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.moderate, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in /var/www/drupal/includes/database.mysqli.inc on line 121.

Comments

zirafa’s picture

Does this happen after you click preview, or after you click submit?

qazasd’s picture

I got the message after i click preview (I only filled in the title.)
When i click submit it seems ok,and the node was created , but if i click manage audio playlist, I got a blank page, and then I go back to previous page it shows another error messages:
Thanks a lot:)

* user warning: Table 'drupal.audio_metadata' doesn't exist query: SELECT COUNT(*) FROM node n INNER JOIN audio_metadata a ON n.vid = a.vid INNER JOIN audio af ON n.vid = af.vid WHERE n.status = 1 in /var/www/drupal/includes/database.mysqli.inc on line 121.
* user warning: Table 'drupal.audio_metadata' doesn't exist query: SELECT DISTINCT n.nid FROM node n INNER JOIN audio_metadata a ON n.vid = a.vid INNER JOIN audio af ON n.vid = af.vid WHERE n.status = 1 ORDER BY n.created DESC LIMIT 0, 7 in /var/www/drupal/includes/database.mysqli.inc on line 121.
* user warning: Table 'drupal.audio_metadata' doesn't exist query: SELECT COUNT(*) FROM node n INNER JOIN audio_metadata a ON n.vid = a.vid INNER JOIN audio af ON n.vid = af.vid WHERE n.status = 1 in /var/www/drupal/includes/database.mysqli.inc on line 121.
* user warning: Table 'drupal.audio_metadata' doesn't exist query: SELECT DISTINCT n.nid FROM node n INNER JOIN audio_metadata a ON n.vid = a.vid INNER JOIN audio af ON n.vid = af.vid WHERE n.status = 1 ORDER BY n.created DESC LIMIT 0, 7 in /var/www/drupal/includes/database.mysqli.inc on line 121.

jivyb’s picture

I had the same problem as you can read about here: http://drupal.org/node/71145

It was caused by two things--

1. the audio_playlist install file didn't install the audio_playlist_metadata table so I did it manually with the code I posted in the above thread.

2. the playlist module is dependent on the audio module and the errors you are getting are because it's looking for the tables installed by the audio module.

Doing these two things took care of the problem and it's been a great module to use.

zirafa’s picture

Ok. Yes, the blowing up when you hit preview is a known problem. I'm still looking into why it's happening. As for the other error, have you installed the audio module? Can you verify the audio module works? The errors indicate that the audio module tables weren't created.

-F

zirafa’s picture

Title: bug report:SQL syntax error » Errors when previewing on node creation

Oh sorry, didn't read the above post yet, sorry. Not sure why the audio/audio_playlist module install files aren't firing correctly. Will keep it in mind. I'll keep this thread open and change the topic to reflect the errors you saw when previewing the node.

zirafa’s picture

This error is occuring when hook_view is being fired because the theme_audio_playlist_teaser and theme_audio_playlist_body perform node_loads on the $node->nid, except $node->nid hasn't been created yet. Most likely it should be possible to pass the full $node to the theme functions, and not perform a node_load.

zirafa’s picture

Assigned: Unassigned » zirafa
Priority: Normal » Critical
Status: Active » Fixed

fixed in HEAD and 4.7.

Anonymous’s picture

Status: Fixed » Closed (fixed)