Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I tried using this syntax inside mysql command line:
insert into users (username, pass, firstname, lastname) values ('admin', sh1('0000'), 'foo', 'bar');
for inserting new row into my users table, unfortuantly I've got the error 1305: FUNCTION users.SH1 does not exist.
so why I'm getting this error? and how to fix the problem? thanks.
Your error message tells you, that function SH1 does not exists but your posted code uses the (existing) function sha1.
Please check your original code ;)
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 months ago.
Improve this question
I have two tables: userdata and videodata. I have the email as the primary key in the first table (userdata) and I want to use email in the second table (videodata) as a foreign key.
userdata table-
Whenever I execute the query for the videodata table creation, I get this error-
Here is the query for creating videodata table-
LIKE is a reserved word. Enclose it in back ticks.
create videDate (
...
`like` int,
...
);
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
SQL beginner here. I have this database: https://github.com/socratica/data/blob/master/earthquake.csv
I'm running a simple Query such as:
SELECT place, DEPTH1 , OCCURED_ON from EARTHQUAKE1;
I execute it, and get the info I need. However, when I add WHERE depth1 = 35; (I edited the depth col just in case it was conflicting with some other clause)
the GUI returns an error. I tried adding ' and using like, also using TRIM but no luck. I also tried retrieving data from another col, but still no good. What is it that I'm doing brutally wrong?
Thanks in advance!
You have a semicolon after your FROM and before your WHERE.
SQL is reading the WHERE as a separate statement and failing.
The ; is a statement terminator.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
I started using MySQL recently and I am facing a problem. I created two tables using create table command and inserted value in the table. These two commands were executed successfully. Then I tried using select command. When I try to execute this command it shows
"select" is not valid at this position for this server version, expecting: (, WITH
Here is my command:
select
*
from Employee,
where Gender="M" and NativePlace="Mumbai",
order Hobby by desc;
What is the reason for this?
There are a couple of syntax errors in your query, try this:
select
*
from Employee
where Gender='M' and NativePlace='Mumbai'
order by Hobby desc;
Remove the commas after Employee and "Mumbai" and you should be good.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I don't get it, this line should work perfectly fine, yet it doesn't. For some reason I am unable to understand why? Can anyone see what I'm missing.
$resclients=$mysqli->query("SELECT id,client_name FROM clients WHERE id = IN ($result)");
The correct SQL query in your case is:
SELECT id,client_name FROM clients WHERE id IN ($result)
as the SQL IN syntax is as follows:
SELECT column_name(s)
FROM table_name
WHERE column_name IN (value1,value2,...);
Try this code:
$resclients=$mysqli->query("SELECT id,client_name FROM clients WHERE id IN ($result)");
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 9 years ago.
Improve this question
INSERT INTO person_data('Key','value',Person_id)
SELECT 'aaa','bbb',1, FROM person_data;
could someone please indicate what is the issue with the above statement?
is that because 'key' and 'value' are sensitive words? Any help?
Key is a column name which also happen to be keyword and should not be put inside qoutes but backticks. Also remove last comma in Select list.
INSERT INTO person_data
( ` KEY ` ,
value,
person_id)
SELECT 'aaa',
'bbb',
1
FROM person_data;
INSERT INTO person_data(`Key`,`value`,`Person_id`) VALUES ('$key', '$value', '$Person_id')
SELECT * FROM person_data;
There is no need to quote the column names.
Try this:
INSERT INTO person_data(Key,value,Person_id) SELECT 'aaa','bbb',1, FROM person_data;