Log in

View Full Version : Anything wrong with this sql code?



KingEvan
30-04-2014, 08:09 PM
I dont see anything wrong, but its not working :/

http://i.imgur.com/RBhYlTU.png

KingEvan
30-04-2014, 08:46 PM
You know it would mean a whole lot if someone helped me. thanks.

Chippiewill
30-04-2014, 08:46 PM
The main issue is it seems you're trying to run 4 different queries at the same time.

KingEvan
30-04-2014, 08:50 PM
The main issue is it seems you're trying to run 4 different queries at the same time.

Hmm... Well im new to sql (so i have no idea what im doing) and in this im trying to make a table with it

Chippiewill
30-04-2014, 08:52 PM
You just want the CREATE TABLE bit then.

KingEvan
30-04-2014, 08:55 PM
You just want the CREATE TABLE bit then.

ok so what do i remove then? the create temp,temp variable, and create view?

Chippiewill
30-04-2014, 08:55 PM
Well those are just comments.

KingEvan
30-04-2014, 08:58 PM
Well those are just comments.

oh yeah LOL. so what do i remove.

Futz
30-04-2014, 09:00 PM
you still need to add the gooey interface

KingEvan
30-04-2014, 09:09 PM
....

Edited by Calum0812 (Forum Moderator): Please do not post pointlessly, thanks!

scottish
30-04-2014, 09:10 PM
You run 4 queries


CREATE TABLE CUSTOMER (
ID..........
............
..........
PHONE VARCHAR(20),
);


run that first


INSERT INTO CUSTOMER VALUES ('EXAMPLE EXAMPLE', 'EXAMPLE', 'NC', 111111111111);

then run a few of those to input info into the db

then you can run


SELECT * FROM CUSTOMER;

to view everything or


SELECT `FULL NAME` FROM CUSTOMER WHERE `FULL NAME` = 'Some Name';

to view a specific full name (use `field` or [field])

KingEvan
30-04-2014, 09:20 PM
You run 4 queries


CREATE TABLE CUSTOMER (
ID..........
............
..........
PHONE VARCHAR(20),
);


run that first


INSERT INTO CUSTOMER VALUES ('EXAMPLE EXAMPLE', 'EXAMPLE', 'NC', 111111111111);

then run a few of those to input info into the db

then you can run


SELECT * FROM CUSTOMER;

to view everything or


SELECT `FULL NAME` FROM CUSTOMER WHERE `FULL NAME` = 'Some Name';

to view a specific full name (use `field` or [field])

Umm... i dont get it..Would i just put all those codes together?

scottish
30-04-2014, 09:25 PM
Where are you running them?

KingEvan
30-04-2014, 09:28 PM
Where are you running them?
what ?

scottish
30-04-2014, 09:41 PM
How are you running the SQL?

Where are you entering it? Are you doing it through an SQL browser? Are you doing it in PHP? what..

KingEvan
30-04-2014, 10:43 PM
How are you running the SQL?

Where are you entering it? Are you doing it through an SQL browser? Are you doing it in PHP? what..

notepad lol

Trinity
30-04-2014, 10:48 PM
notepad lol

And what are you doing after you type it out in notepad?

scottish
30-04-2014, 10:50 PM
You're executing them somewhere, where..

If you know they're failing there's obviously something that's saying the syntax is incorrect or some other error, what's giving this error, how do you know it won't work?

Kyle
30-04-2014, 10:50 PM
notepad is my fav coding program
i think it was used for coding the habbox.com website

KingEvan
01-05-2014, 12:05 AM
You're executing them somewhere, where..

If you know they're failing there's obviously something that's saying the syntax is incorrect or some other error, what's giving this error, how do you know it won't work?

Well hey, i know nothing about sql. which would be a good writing program?

Drew
01-05-2014, 06:17 AM
Well hey, i know nothing about sql. which would be a good writing program?
You can use a GUI client. The only one I've tried is MySQL Workbench.

:Markster:
01-05-2014, 07:35 AM
What Scott is asking is that to run MySQL queries you've got to have a blank database set up. If you don't have one then having the queries in a text file will obviously do nothing. So question is: Do you have a database set up in which you'd run the queries?

Zak
01-05-2014, 09:31 AM
Umm... i dont get it..Would i just put all those codes together?

No run the first one, then the second, then the third and so on.

It's logic, you need to create the table and have values inserted before you expect a result from the SELECT statement.

Want to hide these adverts? Register an account for free!