»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 07-18-2003, 04:17 PM   #1 (permalink)
Registered User
 
BlueIce's Avatar
 
Join Date: Mar 2003
Posts: 102
BlueIce is on a distinguished road
MYsql code

Can some one help me out with a bit of sql code, Ok i have made a table and rows with

CREATE TABLE `Sheet1`"what ever table"
INSERT INTO `Sheet1`VALUES "what ever data"

ok now i want to put in more data but if i use the
INSERT INTO and then the data I just get a sql error, how do you insert more data into a table that is all ready made

if that makes any sence to anyone else

BlueIce is offline   Reply With Quote
Old 07-19-2003, 12:43 AM   #2 (permalink)
Registered User
 
nishark's Avatar
 
Join Date: Aug 2002
Location: Downunder
Posts: 427
nishark is on a distinguished road
UPDATE might help.

the database experts tend to browse the 'Databases' forum under 'WebProgramming, ..,Software Development'. so i guess these kinda questions will get quicker replies there
nishark is offline   Reply With Quote
Old 07-19-2003, 12:48 AM   #3 (permalink)
Registered User
 
Join Date: Oct 2001
Location: TOO close to Wash DC
Posts: 7,956
vass0922 is on a distinguished road
Does the table exist?

can you do

SELECT * FROM Sheet1?

(btw, you may want a more descriptive tablename in the future but I'm assuming this just playing around)

don't use the 'quotes' or "quotes" (at least not in any sql I've ever seen)

INSERT INTO tablename
VALUES ('some string', 23432, 'values from a string');

Doing it that method you must insert values into ALL fields.
You maybe able to use
INSERT INTO tablename
VALUES (NULL, 23432, "values from a string");
but not sure in MySQL

What is the error you're getting?


-- edit --
forgot mysql requires semi colons after statements and to use single quotes in sql to represent strings
Dont' use quotes for table names as they are objects in the database.

UPDATE Only works for existing rows

INSERT INTO

INSERT INTO tbl_name (col1,col2) VALUES(col2*2,15);

IS what you want, from the docs nishark provided
__________________
<< Insert exceedingly large and overly verbose message of how 1337 you are here including full specs of every vehicle you've ever driven and PC you've owned >>

Last edited by vass0922; 07-19-2003 at 01:01 AM.
vass0922 is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 04:52 AM.