Request Update phpMyadmin - mysql

I want Update an SQL tablein phpMyAdmin, to change a values of a column.
My request is:
Update article set Id_LRU where ID_Article='DIEPRESTATION'
It return an 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 'where ID_Article='DIEPRESTATION'' at line 1
I changed it by using like because the type of the field is a Varchar:
Update article set Id_LRU where ID_Article like 'DIEPRESTATION'
Also it got the same error.
How can I correct it please .

You have syntax error.
Update article set Id_LRU ='YOURVALUE' where ID_Article like 'DIEPRESTATION'
Try above query.

Related

MySQL schedule update syintax wrong?

I'm trying to set a trigger in my MySQL database, so I'm using below query:
CREATE EVENT pwdupdate
ON SCHEDULE EVERY 3 MINUTE
DO
UPDATE 'passwords'
SET 'pass'= SUBSTRING((RAND())
Basically I want it to update the pass field of a table with a random string, but it keeps telling me that there's a syintax error:
1064 - 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 ''passwords' SET 'pass'= SUBSTRING((RAND())' at line 5
Any help ?
EDIT : I removed the single quotes as suggested, but still the error remains
You do not need single quotes for table and column name and its invalid in mysql however you can use backticks ``
UPDATE passwords
SET pass= substring(RAND(),8)

why does simple update query in mysql keeps giving error code 1064?

This is the query:
update table tblprobleem set omschrijving='bugfixes' where probleem_id=4;
I checked omschrijving, its datatype is varchar. probleem_id is integer. I tried to rewrite it a thousand times, I just don't get what is wrong with this.
error message:
12:03:05 update table tblprobleem set omschrijving='bugfixes' where
probleem_id=4
Error Code: 1064. 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 'table tblprobleem set omschrijving='bugfixes'
where probleem_id=4' at line 1 0.000 sec
If anybody has the answer, you have my thanks forevere.
Greetz,
John
remove the table in your query make it like this
update tblprobleem set omschrijving='bugfixes' where probleem_id=4

Issues with the mysql query

i am trying to get the result from thquery, but i am getting error on the line 2, where i am using the cast function:
SELECT ticketstickets.`ID`, ticketsusers.`fname`, ticketsusers.`lname`, ticketstickets.`subject`,
ticketstickets.`created`, CAST(ticketstickets.modified AS VARCHAR(100)) as modified,
ticketstickets.`priority`, ticketstickets.`status`,
ticketsdepartments.`name` FROM ticketsusers, ticketstickets
LEFT JOIN ticketsdepartments ON ticketstickets.`DEPARTMENT_ID`= ticketsdepartments.`ID`
WHERE ticketstickets.parent = 0
AND ticketstickets.by=ticketsusers.ID
I tried with convert function too, but same error: [Err] 1064 - 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
'VARCHAR(100)) as modified,
ticketstickets.priority, ticketstickets.`s' at line 2
Please see in the manual that a value cannot be casted to varchar(N). Instead you should cast to char(N) (so without "var").
use that instead
CAST(ticketstickets.modified AS CHAR(100))
Probably the issue is in your CAST statement.
Refer this post to correct your query:
How to use the CAST function correctly in a MySql SELECT statement?

Workbench doesn't allow delete table

I have a table newsletter and I want to delete/update/insert data in it, but when I type
delete * from crm_base.newsletter
for example, it gets an red "X" in the line and gives me the following error message:
Error Code: 1064. 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 '* from crm_base.newsletter_temp' at line 1.
I already unchecked the safe update mode in preferences and resetted workbench, but it still gives me the same error.
Can anyone help me?
delete from crm_base.newsletter
Your syntax is not correct, use DELETE FROM crm_base.newsletter WHERE condition. Check the Delete syntax reference.

SQL Update Error with replace

I can't see what is wrong with this SQL:
UPDATE Show
SET EnterOnine = replace(EnterOnine, 'http://projects.example.co.uk', 'http://www.example.co.uk')
WHERE EnterOnine LIKE '%http://projects.example.co.uk%'
I am getting this error when I enter this into PHPmyadmin:
#1064 - 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 'Show SET EnterOnine = replace(EnterOnine, 'http://projects.example.co.uk' at line 1
Show is a reserved word in mysql, escape with back ticks.
UPDATE `Show` SET ...