 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
PHPBuilder.com: Refactor Your PHP Site Using MySQL Procedures and Views
by Chris Cornutt July 14, 2010 @ 08:46:13
On PHPBuilder.con today there's a new post from Jason Gilmore looking at using procedures and views in MySQL to refactor and simplify your site.
One particularly prominent mistake many programmers make is heavily intermingling the application logic and the domain model. PHP developers, for example, have a tendency to jam a tremendous amount of SQL into their website logic, resulting in undecipherable, unmaintainable code. [...] MySQL stored procedures and views can not only go a long way towards separating the logic and domain model, but they also can easily be integrated into PHP.
He includes several examples of how to create simple views in your database with tables from a possible e-commerce application holding order information and customer details.
voice your opinion now!
mysql view procedure tutorial refactor
9Lessons Blog: Stored Procedure Lesson
by Chris Cornutt July 05, 2010 @ 09:17:06
On the 9Lessons blog today there's a new post looking at stored procedures - how to create them and how to use them from your PHP code.
Are you writing Stored Procedures if not please take a look at this post. Stored procedures can help to improve web application performance and reduce database access traffic. In this post I want to explain how to create and call the stored procedures from database server.
He shows you how to create a sample table and stored procedure on the server side (selecting a username from a users table) and how it compares to a normal SQL query. Two different ways to input values into the procedure are shown as well.
voice your opinion now!
tutorial stored procedure mysql
Chris Jones: Converting REF CURSOR to PIPE for Performance in PHP OCI8 and PDO_OCI
by Chris Cornutt November 04, 2008 @ 08:48:36
In this new post to his blog Chris Jones looks at an option to increase the performance of your PHP/Oracle application even more - converting a REF CURSOR into a piped data set via the PDO_OCI extension.
REF CURSORs are common in Oracle's stored procedural language PL/SQL. They let you pass around a pointer to a set of query results. However in PHP, PDO_OCI doesn't yet allow fetching from them. [...] One workaround, when you can't rewrite the PL/SQL code to do a normal query, is to write a wrapper function that pipes the output.
He includes an example, creating an example myproc() that contains the query to select the last names of all employees in the table. This procedure is put inside of a package so it can be called directly in the SQL statement and the ref cursor can be automatically piped to output.
voice your opinion now!
oracle oci8 extension pdooci performance refcursor pipe procedure package
EasyTech Blog: Executing PL/SQL code in Zend Framework
by Chris Cornutt October 29, 2008 @ 11:15:17
On the EasyTech blog, there's a recent post for Zend Framework developers out there working with the Oracle database showing how to execute PL/SQL code from your Zend_Db queries.
Calling PL/SQL code from PHP can be tricky sometimes, specially when the PL/SQL procedure has input and output parameters. In this posting I will show you how to call a procedure from the PHP using Zend Framework. I will assume you have some experience using Zend Framework, specially the Database module (Zend_db).
He walks through the creation of a simple PL/SQL stored procedure and how to prepare your query to get results out of it (Zend_Db_Statement_Oracle and an execute call). There's a few stipulations you'll need to follow - named parameters, reserving space for the output and using references for output variables.
voice your opinion now!
plsql oracle tutorial zendframework stored procedure
php|architect: Stored Procedure Programming for MySQL5 (Part 2)
by Chris Cornutt August 08, 2006 @ 12:11:54
The A/R/T article repository (from php|architect) has posted the second part of their series covering stored procedure programming in MySQL by Ligaya Turmelle.
Now that we become familiar with the fundamentals of stored procedures it is time to start playing with the "Big Boy Toys". This article will go over stored procedures's built in error handling, the security features available, various "extras" available, what isn't allowed in a stored procedure, and some basic administration of the stored procedures. So lets stop talking and bust open the toy box and start playing!
Since they've already gotten the groundwork laid in the previous article, they jump right into the transactions in this part. In this example, they create a "mass insert", show hoe to create some error handling, add in a dash of security, and toss in a few extras. There's also a few small gotchas included to watch out for.
voice your opinion now!
mysql stored procedure programming part2 mass insert error security mysql stored procedure programming part2 mass insert error security
php|architect: Stored Procedure Programming for MySQL5 (Part 1)
by Chris Cornutt July 10, 2006 @ 16:37:57
The php|architect A/R/T article repository has a new tutorial today, covering stored procedure programming for MySQL (by Ligaya Turmelle).
With the release of MySQL5 a bold new world opens up to the PHP developer... the world of a database programmer. In this world the interaction with the data can be done right where the data is located - not in a script that is far far away in a distant server. In this article we will be taking you on a journey that will introduce you to MySQL's stored procedures.
They cover some of the background of transactions and some of the basic concepts behind them. All of the examples provided are done from the command line in this part of the series, but PHP relevant examples should be coming up shortly.
voice your opinion now!
mysql stored procedure tutorial mysql stored procedure tutorial
|
Community Events
Don't see your event here? Let us know!
|