Share on Google+Share on Google+

Wranorn
Why are MySQL Routines and Views not used with PHP?
2 Answer(s)      3 years and 5 months ago
Posted in : PHP

I've been looking at a number of web sites, frameworks, and scripts written in PHP and noticed NONE of them make use of MySQL Views or Routines. Alarmingly very very few even use indices. I'm wondering if anyone else has noticed this and can shed some light on this phenomenon. To me it seems that with PHP there has been a great deal of dumbing down when it comes to "proper" database usage.

Ads

View Answers

November 14, 2013 at 4:25 PM


Hi,

View is stored as just a simple SQL in the database. When user calls a view from the program it reads the sql of the view and then executes the query. So, there is no performance gain in the application. It is similar to executing the query from your program.

If you use the view then you may have to write extra code and logic to pass the parameters to the view.

So, its better to just use SQL and execute from your program itself.

Thanks



November 28, 2013 at 3:01 AM


Thank you for your thoughts, I agree in using views it's more of a do what makes sense for your application. Personally I prefer them for reporting more then anything else.

Have you any input on why indices and routines aren't used?










Tutorials   
Java Spring Hibernate Struts Training I am Java programmer. Should I learn Java Script or Python? Delete multiple records with pagination by selecting checkboxes How to add one hour in php date? connection in php connection in php connection in php PHP magento how to make previous and next Button Display Data in php session written exam display database results question create a simple form Magento Strings in PHP Zend Framework Installation in xampp? How to prevent adding duplicate items to the shopping cart php problem maximum execution time of 30 seconds exceeded in php Call-time pass-by-reference has been removed in HTTP_POST_VARS is deprecated $_GET[] index is not defined Function mysql_db_query() is deprecated Function mysql_db_query() is deprecated Function split() is deprecated Fatal error: Call to undefined function session_register() in .php file php tag not working Error reporting in PHP Why are MySQL Routines and Views not used with PHP? How to add Click to copy function to my wordpres blog? connection of php to MySQL. loan calculator Datepicker not getting called through include function of php change url string integrate login in php Installation of wamp server Display PHP clock with user input date and time value in div from php, reloading form pre-populate form developing a system using php n mysql Configure apache Tomcat to work with Eclipse and PDT in php How to display a file for 24 hours? LOGIN ERROR LOGIN FAILED", $_SESSION['login fail']='0',}?> I GOT ERROR FOR MY PROJECT PHP Sending emails and insert into trable Tutorial college Student Admission System PLZ HELP ME. i need php code.

Ads

 
Advertisement null

Ads