ziedinjsh Posted February 23, 2013 Report Share Posted February 23, 2013 nu nekādīgi nevaru iebraukt!!!! tik vnienkārša lieta <?php include('datubaaze.php'); mysql_query("update wall set read='yes'") or die(mysql_error()); ?> 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 'read='yes'' at line 1 Es neredzu nekādu sintakses kļūdu! citā php failā šāda veida update strādā... Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted February 23, 2013 Report Share Posted February 23, 2013 http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html Quote Link to comment Share on other sites More sharing options...
daGrevis Posted February 23, 2013 Report Share Posted February 23, 2013 Semikols! Quote Link to comment Share on other sites More sharing options...
WingTsun Posted February 23, 2013 Report Share Posted February 23, 2013 (edited) <?php include('datubaaze.php'); mysql_query("UPDATE `wall` SET `read`='yes'") or die(mysql_error()); ?> Pamēģini šitā! at line 1 Iespējams, ka kļūda ir citā kverijā. Ieteiktu papētīt "datubaaze.php". Pamēģini to include noņemt, un paskaties, vai tad arī ir kļūda, ja nav, tad zināsi, ka kļūda rodas tur. Edited February 23, 2013 by WingTsun Quote Link to comment Share on other sites More sharing options...
aaxc Posted February 24, 2013 Report Share Posted February 24, 2013 rATRIJS jau visu pateica, read ir reserved word, tākā pārveido savu query šādi: update wall set `read`='yes' Vai tu skaidri zini, ka gribi UPDATE taisīt bez WHERE nosacījumiem? Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted February 24, 2013 Author Report Share Posted February 24, 2013 jā, jo man vajadzēja visas rindās vienu un to pašu ielikt :) Quote Link to comment Share on other sites More sharing options...
daGrevis Posted February 24, 2013 Report Share Posted February 24, 2013 Pag, semikolu nevajag? Quote Link to comment Share on other sites More sharing options...
marrtins Posted February 24, 2013 Report Share Posted February 24, 2013 Nē. Quote Link to comment Share on other sites More sharing options...
aaxc Posted February 24, 2013 Report Share Posted February 24, 2013 Pag, semikolu nevajag? PHP liimenii izpildot query semikols nekad nav bijis vajadziigs. Quote Link to comment Share on other sites More sharing options...
codez Posted February 24, 2013 Report Share Posted February 24, 2013 PHP liimenii izpildot query semikols nekad nav bijis vajadziigs.Kāds sakars ar PHP? Semikols atdala komandas, ja viena komanda, tātad semikolu nevajag. Tā būs gan PHP, gan pyhonā, gan nodejs, gan c++. Quote Link to comment Share on other sites More sharing options...
marrtins Posted February 24, 2013 Report Share Posted February 24, 2013 Bet tikai ne mysql shellā Quote Link to comment Share on other sites More sharing options...
codez Posted February 24, 2013 Report Share Posted February 24, 2013 Bet tikai ne mysql shellā1. mysql shells ir viena atsevišķa programma, kur semikols ir programmas īpatnība, nevis mysql db api īpatnība. 2. arī mysql shellā var iztikt bez semikola. show databases\g Quote Link to comment Share on other sites More sharing options...
marrtins Posted February 24, 2013 Report Share Posted February 24, 2013 Nu gan jau var arī aizstāt ar vēl citu. Quote Link to comment Share on other sites More sharing options...
daGrevis Posted February 24, 2013 Report Share Posted February 24, 2013 Tā kā lietoju SQL tikai caur konsoli, nezināju. Quote Link to comment Share on other sites More sharing options...
codez Posted February 24, 2013 Report Share Posted February 24, 2013 Tā kā lietoju SQL tikai caur konsoli, nezināju.pythonā iztiec tikai ar ORM? 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.