Jump to content
php.lv forumi

Recommended Posts

Posted

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ā...

Posted (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 by WingTsun
Posted

  1. rATRIJS jau visu pateica, read ir reserved word, tākā pārveido savu query šādi:

    update wall set `read`='yes'
  2. Vai tu skaidri zini, ka gribi UPDATE taisīt bez WHERE nosacījumiem?
Posted

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++.

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...