Garethp Posted October 8, 2009 Share Posted October 8, 2009 Okay, so I've gotten into the habbit of using ` for all table and column names because I'm not sure what is and is not reserved. But I've recently been told this should be avoided unless I'm using a reserved name. Why is this? Quote Link to comment https://forums.phpfreaks.com/topic/176930-why-shouldnt-i-use/ Share on other sites More sharing options...
trq Posted October 8, 2009 Share Posted October 8, 2009 Why is this? Because it is mysql specific and not portable between RDBMS's. Quote Link to comment https://forums.phpfreaks.com/topic/176930-why-shouldnt-i-use/#findComment-932860 Share on other sites More sharing options...
Garethp Posted October 8, 2009 Author Share Posted October 8, 2009 What is RDBMS? And what's the difference between mysql and sql? Quote Link to comment https://forums.phpfreaks.com/topic/176930-why-shouldnt-i-use/#findComment-932868 Share on other sites More sharing options...
trq Posted October 8, 2009 Share Posted October 8, 2009 An RDBMS is a 'relational database management system' MySql is an RDBMS. SQL is a language used to query data contained within a RDBMS. Different RDBMS's use different dialects of SQL, `backticks` are a feature that is specific to MySQL only. Quote Link to comment https://forums.phpfreaks.com/topic/176930-why-shouldnt-i-use/#findComment-932870 Share on other sites More sharing options...
PFMaBiSmAd Posted October 8, 2009 Share Posted October 8, 2009 I'm not sure what is and is not reserved There's a table in the documentation and when you do use them as table/column names, your query fails to execute and produces an SQL syntax error (see the mysql_error() function for debugging) where the part of the query that is printed in the error message, starts with the reserved keyword that was found in a context where it does not belong - http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html Quote Link to comment https://forums.phpfreaks.com/topic/176930-why-shouldnt-i-use/#findComment-932989 Share on other sites More sharing options...
fenway Posted October 8, 2009 Share Posted October 8, 2009 It's also bad practice to use reserved keywords and get away with it. Quote Link to comment https://forums.phpfreaks.com/topic/176930-why-shouldnt-i-use/#findComment-933150 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.