ziedinjsh Posted February 23, 2013 Report 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
rATRIJS Posted February 23, 2013 Report Posted February 23, 2013 http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html Quote
WingTsun Posted February 23, 2013 Report 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
aaxc Posted February 24, 2013 Report 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
ziedinjsh Posted February 24, 2013 Author Report Posted February 24, 2013 jā, jo man vajadzēja visas rindās vienu un to pašu ielikt :) Quote
aaxc Posted February 24, 2013 Report Posted February 24, 2013 Pag, semikolu nevajag? PHP liimenii izpildot query semikols nekad nav bijis vajadziigs. Quote
codez Posted February 24, 2013 Report 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
codez Posted February 24, 2013 Report 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
marrtins Posted February 24, 2013 Report Posted February 24, 2013 Nu gan jau var arī aizstāt ar vēl citu. Quote
daGrevis Posted February 24, 2013 Report Posted February 24, 2013 Tā kā lietoju SQL tikai caur konsoli, nezināju. Quote
codez Posted February 24, 2013 Report Posted February 24, 2013 Tā kā lietoju SQL tikai caur konsoli, nezināju.pythonā iztiec tikai ar ORM? Quote
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.