pengu Posted November 23, 2010 Share Posted November 23, 2010 I swear I had read a tutorial on this site, but I must be mistaken as I can't find it. I did some googling on it.. but not to happy with the tutorials. Just wondering if someone could point me in a better direction. I'm wondering if I can take advantage of these. Like if I put these in a "config" file that is called on every PHP page and I have 2 or 3 SQL queries that I always want to run, a SELECT and UPDATE (maybe a delete). I could call these at will.. right? Without having to rewrite the query a million times? Any help is most appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/219520-php-mysql-prepared-statements/ Share on other sites More sharing options...
trq Posted November 23, 2010 Share Posted November 23, 2010 SQL queries are just strings, so store the strings in your config file and include it. Prepared statements are something all together entirely different. Quote Link to comment https://forums.phpfreaks.com/topic/219520-php-mysql-prepared-statements/#findComment-1138202 Share on other sites More sharing options...
pengu Posted November 23, 2010 Author Share Posted November 23, 2010 I know I could do it that way. But.. Any point in using Prepared Statements? (Security wise) Quote Link to comment https://forums.phpfreaks.com/topic/219520-php-mysql-prepared-statements/#findComment-1138204 Share on other sites More sharing options...
trq Posted November 23, 2010 Share Posted November 23, 2010 it's always better to use prepared statements where possible as they can help enforce data types. Quote Link to comment https://forums.phpfreaks.com/topic/219520-php-mysql-prepared-statements/#findComment-1138209 Share on other sites More sharing options...
pengu Posted November 23, 2010 Author Share Posted November 23, 2010 it's always better to use prepared statements where possible as they can help enforce data types. Thanks. Know any decent tutorials? Quote Link to comment https://forums.phpfreaks.com/topic/219520-php-mysql-prepared-statements/#findComment-1138213 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.