First of all i am testing it on my server for learning purpose. The condition here is i want to insert a entry in test table in database and
SELECT * FROM `student` WHERE `name` LIKE '% ".$name." %';
here $name is coming from a input box which is created by me. And another most important thing is nothing will be printed on frontend if query execute correctly. That's why i am trying to insert the data.
I am trying it by using union query but it is not working at all. Please let me know if it is possible or not.
Here is the query that is working in phpmyadmin but same query is not working on frontend
SELECT * FROM `student` WHERE `name` LIKE '%mike%' OR 1=1 UNION INSERT INTO test (`id`,`value`) VALUES (36,'testdata')