MySQL variables, modifying Microsoft SQL sequence insert for use in mysql

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I have the following microsoft SQL statement that inserts 25 new
records in sequence.  However I am trying to modify this to work in

I cant seem to get the variable decleration right.  I tried using
DECLARE CurVal int but that generates a mysql error.  How can I modify
the code below to work under mysql?

DECLARE @CurVal int
DECLARE @FinalVal int

SELECT @CurVal = MAX(IdField) FROM MyTable

SET @FinalVal = @CurVal + 25

WHILE (@CurVal < @FinalVal)
    SET @CurVal = @CurVal + 1

INSERT INTO `tbl_listings` ( `listnum`)
VALUES (@Curval);

Site Timeline