קוד mysql שעובד ב-phpmyadmin אבל לא ב-php
היי, אני מנסה להריץ שאילתת mysql דרך php אבל מקבל הודעת שגיאה:
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 'UPDATE movies SET rank = (@p:=@p+1) ORDER BY value DESC' at line 1
כאשר אני מנסה להריץ את השאילת הבאה:
SET @p=0; UPDATE cms_module_movies_movie SET rank = (@p:=@p+1) ORDER BY stock_value DESC
דרך אגב, כאשר אני מנסה להריץ את השאילתה דרך ה-phpmyadmin, השאילתה עובדת!
תודה לעוזרים.
היי, אני מנסה להריץ שאילתת mysql דרך php אבל מקבל הודעת שגיאה:
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 'UPDATE movies SET rank = (@p:=@p+1) ORDER BY value DESC' at line 1
כאשר אני מנסה להריץ את השאילת הבאה:
SET @p=0; UPDATE cms_module_movies_movie SET rank = (@p:=@p+1) ORDER BY stock_value DESC
דרך אגב, כאשר אני מנסה להריץ את השאילתה דרך ה-phpmyadmin, השאילתה עובדת!
תודה לעוזרים.