
03-06-04, 02:58 PM
|
|
Newbie Coder
|
|
Join Date: Aug 2003
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
MySQL Query problem
Hi there,
I'm trying to get my query to do this:
CREATE TABLE `tbl_Cheats_GC` (
`A` TEXT NOT NULL,
`B` TEXT NOT NULL
`C` TEXT NOT NULL,
`D` TEXT NOT NULL,
`E` TEXT NOT NULL,
`F` TEXT NOT NULL,
`G` TEXT NOT NULL,
`H` TEXT NOT NULL,
`I` TEXT NOT NULL,
`J` TEXT NOT NULL,
`K` TEXT NOT NULL,
`L` TEXT NOT NULL,
`M` TEXT NOT NULL,
`N` TEXT NOT NULL,
`O` TEXT NOT NULL,
`P` TEXT NOT NULL,
`Q` TEXT NOT NULL,
`R` TEXT NOT NULL,
`S` TEXT NOT NULL,
`T` TEXT NOT NULL,
`U` TEXT NOT NULL,
`V` TEXT NOT NULL,
`W` TEXT NOT NULL,
`X` TEXT NOT NULL,
`Y` TEXT NOT NULL,
`Z` TEXT NOT NULL,
)
BUT, I get this error: You have an error in your SQL syntax near 'C` TEXT NOT NULL,
`D` TEXT NOT NULL,
`E` TEXT NOT NULL,
`F` TEXT NOT NULL,' at line 4
Any ideas please?
-Wraith
~~EDIT~~
Ok, thats fixed (no , at the end of line B), now i get this error: You have an error in your SQL syntax near ')' at line 28
Last edited by Wraith; 03-06-04 at 03:04 PM.
|

03-06-04, 03:04 PM
|
 |
Newbie Coder
|
|
Join Date: Mar 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
Solution..
The problem lies just after `B`, where a comma is missing and after `Z`, where a comma should not be.
Hope this helps.
Quote:
|
Originally Posted by Wraith
Hi there,
I'm trying to get my query to do this:
CREATE TABLE `tbl_Cheats_GC` (
`A` TEXT NOT NULL,
`B` TEXT NOT NULL
`C` TEXT NOT NULL,
`D` TEXT NOT NULL,
`E` TEXT NOT NULL,
`F` TEXT NOT NULL,
`G` TEXT NOT NULL,
`H` TEXT NOT NULL,
`I` TEXT NOT NULL,
`J` TEXT NOT NULL,
`K` TEXT NOT NULL,
`L` TEXT NOT NULL,
`M` TEXT NOT NULL,
`N` TEXT NOT NULL,
`O` TEXT NOT NULL,
`P` TEXT NOT NULL,
`Q` TEXT NOT NULL,
`R` TEXT NOT NULL,
`S` TEXT NOT NULL,
`T` TEXT NOT NULL,
`U` TEXT NOT NULL,
`V` TEXT NOT NULL,
`W` TEXT NOT NULL,
`X` TEXT NOT NULL,
`Y` TEXT NOT NULL,
`Z` TEXT NOT NULL,
)
BUT, I get this error: You have an error in your SQL syntax near 'C` TEXT NOT NULL,
`D` TEXT NOT NULL,
`E` TEXT NOT NULL,
`F` TEXT NOT NULL,' at line 4
Any ideas please?
-Wraith
|
__________________
<font face="Verdana"><a href="http://www.generalscripting.com">General Scripting</a> Web Development Services</font>
|

03-06-04, 03:05 PM
|
|
Newbie Coder
|
|
Join Date: Aug 2003
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
ty m8
Now I need help with this:
DB = themn
Table = tbl_nintendo
Table2= tbl_xbox
Table3= tbl_ps2
In each table there would be parts (A, B, C, D, E etc)
If they selected E and there was no data, how could I put an error? And if there was more data (game names) in there, and they selected one, how would it get the cheats for that game (Your really deep into the db now).
-Wraith
|

03-06-04, 03:16 PM
|
 |
Newbie Coder
|
|
Join Date: Mar 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
Hi Wraith..
There need to be more tables.
The tables you mentioned below are for GAME TITLES for the respective console. Each table should have only 2 colums, basically they are:
1) ID
2) Game Title
There shouldn't be parts A,B,C,D,E... There's no need for it.
The second complimentary table would be called ninendo_cheats, xbox_cheats, ps2_cheats, etc.
They should in return hold the cheats for individual games. Again, they will contain 2 columms
1) ID ( the key taken from the Games Table )
2) Cheats ( the text for the cheats for this particular game, whose id is referenced from the other table).
Alternatively, you could combine everything into one table, by simply inserting a 'cheat' column into the first table, thus making it a three column table.
Anyway, do consider General Scripting to deliver you such a service if you ever need someone to do it. We can accomplish that, a multi-paging page slider system, a search engine to search for your cheats, sorting criterias as well as keyword highlighting.
Quote:
|
Originally Posted by Wraith
ty m8
Now I need help with this:
DB = themn
Table = tbl_nintendo
Table2= tbl_xbox
Table3= tbl_ps2
In each table there would be parts (A, B, C, D, E etc)
If they selected E and there was no data, how could I put an error? And if there was more data (game names) in there, and they selected one, how would it get the cheats for that game (Your really deep into the db now).
-Wraith
|
__________________
<font face="Verdana"><a href="http://www.generalscripting.com">General Scripting</a> Web Development Services</font>
|

03-06-04, 03:47 PM
|
|
Newbie Coder
|
|
Join Date: Aug 2003
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Great ta!
Now, What about counting how many H's are in the ID colum?
-Neo
|

03-06-04, 05:16 PM
|
 |
Community Liaison
|
|
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
|
|
Quote:
|
Originally Posted by Wraith
~~EDIT~~
Ok, thats fixed (no , at the end of line B), now i get this error: You have an error in your SQL syntax near ')' at line 28
|
after `Z` TEXT NOT NULL, remove the comma... commas separate items, so you don't need one after the last item.
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|