![]() |
|
Prevent sql injections on select * - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: PHP (https://sinister.ly/Forum-PHP) +--- Thread: Prevent sql injections on select * (/Thread-Prevent-sql-injections-on-select) Pages:
1
2
|
Prevent sql injections on select * - DarthVader - 02-26-2016 Hey a newbie question : i wanna select all data from a table(i.e: Select * From `something`) but i've read somewhere that this is a bit risky so my question is: Is there any way to prevent sql injection while selecting all data from a table ? RE: Prevent sql injections on select * - Mafia - 02-26-2016 Use PDO statements. http://php.net/manual/en/class.pdostatement.php RE: Prevent sql injections on select * - DarthVader - 02-26-2016 (02-26-2016, 08:45 PM)Mafia Wrote: Use PDO statements. no way to do it using mysqli ? RE: Prevent sql injections on select * - Mafia - 02-26-2016 (02-26-2016, 09:34 PM)DarthVader Wrote:(02-26-2016, 08:45 PM)Mafia Wrote: Use PDO statements. I'm not sure, I have always used PDO statements, but I guess you can just sanitise it and check before it's executed. RE: Prevent sql injections on select * - cisla - 02-28-2016 You can also prepare queries with unnamed binding using MySQLi. RE: Prevent sql injections on select * - Para - 02-28-2016 (02-26-2016, 09:34 PM)DarthVader Wrote:(02-26-2016, 08:45 PM)Mafia Wrote: Use PDO statements. You can but PDO is the preferred method nowadays. RE: Prevent sql injections on select * - DarthVader - 02-28-2016 (02-28-2016, 05:50 PM)Para Wrote:(02-26-2016, 09:34 PM)DarthVader Wrote: no way to do it using mysqli ? Okay, thanks for your answers guys RE: Prevent sql injections on select * - Para - 02-28-2016 (02-28-2016, 05:58 PM)DarthVader Wrote:(02-28-2016, 05:50 PM)Para Wrote: You can but PDO is the preferred method nowadays. I learnt PDO from this site a while back http://prash.me RE: Prevent sql injections on select * - DarthVader - 02-28-2016 (02-28-2016, 05:59 PM)Para Wrote:(02-28-2016, 05:58 PM)DarthVader Wrote: Okay, thanks for your answers guys Oh thank you this is way more clear than the php.net manual RE: Prevent sql injections on select * - Para - 02-28-2016 (02-28-2016, 07:10 PM)DarthVader Wrote:(02-28-2016, 05:59 PM)Para Wrote: I learnt PDO from this site a while back PHP.net can be great sometimes but the examples can be muddled and people use functions differently which can be confusing. |