yeahz Posted October 21, 2009 Report Share Posted October 21, 2009 Kās te nepareizs? $get = $_GET['albumid']; $max_order = mysql_fetch_array(mysql_query("SELECT MAX(order) AS max_order FROM gallery_pictures WHERE albumid=$get")); Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ..... $_GET['albumid'] ir parasts skaitlis. Visi order, albumid un gallery_pictures eksistē. Quote Link to comment Share on other sites More sharing options...
waplet Posted October 21, 2009 Report Share Posted October 21, 2009 Pamēgini gallery_pictures ielikt ` <- šajos Quote Link to comment Share on other sites More sharing options...
yeahz Posted October 21, 2009 Author Report Share Posted October 21, 2009 Nestrādā. Quote Link to comment Share on other sites More sharing options...
briedis Posted October 21, 2009 Report Share Posted October 21, 2009 izdrukā mysql_error() saturu... Quote Link to comment Share on other sites More sharing options...
yeahz Posted October 21, 2009 Author Report Share Posted October 21, 2009 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 'order) AS max_order FROM `gallery_pictures` WHERE albumid=2' at line 1 Quote Link to comment Share on other sites More sharing options...
Val Posted October 21, 2009 Report Share Posted October 21, 2009 http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html Quote Link to comment Share on other sites More sharing options...
briedis Posted October 21, 2009 Report Share Posted October 21, 2009 (edited) SELECT MAX([order]) AS max_order FROM gallery_pictures WHERE albumid=$get Edited October 21, 2009 by briedis Quote Link to comment Share on other sites More sharing options...
yeahz Posted October 21, 2009 Author Report Share Posted October 21, 2009 Tās kvadrātiekavas neko nelīdzēja. Nomainīju order uz order_number un strādā. Quote Link to comment Share on other sites More sharing options...
marcis Posted October 22, 2009 Report Share Posted October 22, 2009 ORDER ir rezrvētais vārds, tev būtu bijis jāselektē MAX(`order`) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.