0

it is showing error in savepoint when i type savepoint a; and the error is unrecognized statement type

i am running code on phpmyadmin in wamp server

This is my SQL:

START TRANSACTION
INSERT INTO class VALUES(5, 'Rahul');

COMMIT

UPDATE class SET name = 'Abhijit' WHERE id = '5';

SAVEPOINT ab;(error: unrecognized statement type)

INSERT INTO class VALUES(6, 'Chris');

SAVEPOINT B;(error : unrecognized statement type)

INSERT INTO class VALUES(7, 'Bravo');

SAVEPOINT C;(error: unrecognized statement type)

SELECT * FROM class;

it should not show error there

Paul Spiegel
  • 30,925
  • 5
  • 44
  • 53
  • Please post the versions of MySQL and phpMyAdmin. Fix your code (there are missing `;` after `START TRANSACTION` and `COMMIT`). Write your comments as comments (use ` -- your comment` or `# your comment`). Change your code to be reasonable (savepoints make no sense if not in transaction). However - I can't reproduce your issue in the current [demo](https://www.phpmyadmin.net/try/). – Paul Spiegel May 26 '19 at 00:12

1 Answers1

0

remove semi colon (;) after "UPDATE class SET name = 'Abhijit' WHERE id = '5'" statement & after "INSERT INTO class VALUES(6, 'Chris');" and remove ending semicolon of above line in SAVEPOINT. This solution is work for me

Kaumadie Kariyawasam
  • 1,232
  • 3
  • 17
  • 35