MySQL version 5.0.16

Windows XP

PHP 5.

 

I have this query that when I run it in SQL Manager 2005, it runs
beautifully, but when I stick the same query in Dreamweaver using PHP -
MySQL I get an error. I did some research and most roads lead to version
compatibility. Okay, that's fine, but I'm not sure how to fix it? Both
Dreamweaver and SQL manager are being run on the same box so I don't get the
version difference?? It's obviously the same version of MySQL.

 

Can someone point me to a good PHP mailing list?

 

My apologies if this is not the right list to ask this question, but I'm
sure some people here use PHP also.

 

>From Dreamweaver

 

"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 '; CREATE
TEMPORARY TABLE t ( module_id INT, module_name VARCHAR(32), ' at line 1"

 

Here is the query:

 

DROP TABLE IF EXISTS t;

 

CREATE TEMPORARY TABLE t (

    module_id INT,

    module_name VARCHAR(32),

    email VARCHAR(60),

    time_zone TINYINT (4),

    date_time DATETIME,

    score INT

  );

  

INSERT INTO t

SELECT

  completed_modules.module_id,

  modules.module_name,

  students.email,

  students.time_zone,

  completed_modules.date_time,

  max(completed_modules.score) AS score

  

FROM

  students

  INNER JOIN completed_modules ON (students.email = completed_modules.email)

  INNER JOIN modules ON (completed_modules.module_id = modules.module_id)

 

GROUP BY module_id, email;

 

SELECT

module_id,

module_name,

email,

score,

DATE_FORMAT(DATE_SUB(date_time, INTERVAL time_zone HOUR),'%e %M %Y') as
'date_time'

FROM t

WHERE

  email = '[EMAIL PROTECTED]'

ORDER BY date_time DESC;

 

 

Thanks for any help on this!

 

-Brian Menke

 

Reply via email to