Help with mysql query..

Codes here !

Moderators: macek, egami, gesf

DeathRelic0
New php-forum User
New php-forum User
Posts: 1
Joined: Fri May 11, 2012 7:32 am

Help with mysql query..

Postby DeathRelic0 » Fri May 11, 2012 7:37 am

hey guys, really hoping u can help me out cause this is supposed to be soo simple but i just cant figure it out..

i do know a reasonable amount of sql i guess, but new to mysql, and i cant figure out how to create a procedure...

this is my code, really hope someone can help me out....



CREATE PROCEDURE inserttoscrapbookSD
(owner1 VARCHAR(50),
poster1 VARCHAR(50),
Scrap1 VARCHAR(50),
Date_time1 DECIMAL,
InsertedOrNot DECIMAL
)
BEGIN

INSERT INTO scrapbook (Owner)

VALUES(owner1)

END





i know there are a lot of variables being passed, but just using one variable atm because if it works for one, itll work for all.. i tried with and without a semicolon ( ; ) at the end of "END" and at the end of "...VALUES(owner1)" but no luck.. it says

#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 'END' at line 14

thanks in advance

Antrikssh
New php-forum User
New php-forum User
Posts: 22
Joined: Wed May 02, 2012 5:27 am

Re: Help with mysql query..

Postby Antrikssh » Mon May 14, 2012 6:35 am

Hello,

I think this may help you

CREATE PROCEDURE inserttoscrapbookSD
(owner1 VARCHAR(50),
poster1 VARCHAR(50),
Scrap1 VARCHAR(50),
Date_time1 DECIMAL,
InsertedOrNot DECIMAL
)
BEGIN

INSERT INTO scrapbook (Owner)

VALUES('owner1')

END

when we insert the string data into the table, it will always in ' ' like 'owner1' or when we insert the int data then we simply write without any ' '.

Try this I hope this will help you......

Regards,
Antrikssh.....
:)


Return to “mySQL & php coding”

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest