Hello,
I am quite new to mySQL so I hope this is easy for you to help me with.
I have written the following code that inserts a record, then saves the LAST_INSERT_ID() value to @PrenId and updates the record again:
insert into db1017731_nyhetsbrev.Prenumeranter (Pren_Namn, Pren_Epost) values ('TestNamn','TestEpost');
set @PrenId := LAST_INSERT_ID();
UPDATE db1017731_nyhetsbrev.Prenumeranter SET Pren_kod=encrypt(@PrenId) WHERE Pren_id=@PrenId;
This works fine in phpMyAdmin but when I run it within asp-code on a web server I get the error:
[MySQL][ODBC 3.51 Driver][mysqld-5.0.51a-community]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 '; set @PrenId := LAST_INSERT_ID(); UPDATE db1017731_nyhetsbrev.Prenumeranter SET' at line 1
Does anyone know what to do to make it work on asp page as well as writing the query in phpMyAdmin?
Thanks,
Johan