<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sun, 19 May 2013 00:31:06 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Ulf Wendel's Blog: Using MySQL stored procedures with PHP mysqli]]></title>
      <guid>http://www.phpdeveloper.org/news/17088</guid>
      <link>http://www.phpdeveloper.org/news/17088</link>
      <description><![CDATA[<p>
<i>Ulf Wendel</i> has a new post today with details on <a href="http://blog.ulf-wendel.de/2011/using-mysql-stored-procedures-with-php-mysqli/">using stored procedures with mysqli</a> - not overly difficult if you know how to handle the IN, OUT and INOUT parameters. He includes a few code examples showing how to use them.
</p>
<blockquote>
Out of curiosity I asked another friend, a team lead, how things where going with their PHP MySQL project, for which they had planned to have most of their business logic in stored procedures. I got an email in reply stating something along the lines: "Our developers found that mysqli does not support stored procedures correctly. We use PDO.". Well, the existing documentation from PHP 5.0 times is not stellar, I confess. But still, that's a bit too much... it ain't that difficult. And, it works.
</blockquote>
<p>
He describes the three parameters (IN, OUT and INOUT) and gives some examples of setting/getting them from your SQL statements. They're all still set up using the <a href="http://us2.php.net/manual/en/mysqli.query.php">query method</a> on your connection as well as handling the result sets that come back and working with prepared statements.
</p>]]></description>
      <pubDate>Fri, 04 Nov 2011 11:39:18 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Performance analysis of Stored Procedures with PDO and PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16285</guid>
      <link>http://www.phpdeveloper.org/news/16285</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has <a href="http://gonzalo123.wordpress.com/2011/05/02/performance-analysis-of-stored-procedures-with-pdo-and-php/">posted the results of some testing</a> he's done in using stored procedures in a PHP application. He compares the run time of two different scripts, one using prepared statements and one without, to see which would perform better in the long run.
</p>
<blockquote>
Last week I had an interesting conversation on <a href="http://twitter.com/#!/gonzalo123">twitter</a> about the usage of stored procedures in databases. Someone told stored procedure are evil. I'm not agree with that. Stored procedures are a great place to store business logic. In this post I'm going to test the performance of a small piece of code using stored procedures and using only PHP code.
</blockquote>
<p>
In the end, the results showed that the stored procedures method was actually faster and used a bit less memory than the normal "plain PHP" method. It can be a bit more difficult to use than just a SQL statement in a string (properly escaped, of course) but can be worth the extra hassle when you need that performance boost.
</p>]]></description>
      <pubDate>Tue, 03 May 2011 08:38:32 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Swan's Blog: Do Stored Procedures Protect Against SQL Injection?]]></title>
      <guid>http://www.phpdeveloper.org/news/15922</guid>
      <link>http://www.phpdeveloper.org/news/15922</link>
      <description><![CDATA[<p>
<i>Brian Swan</i> has a new post answering a question he's gotten about the stored procedures that the SQL Server database includes and whether or not they <a href="http://blogs.msdn.com/b/brian_swan/archive/2011/02/16/do-stored-procedures-protect-against-sql-injection.aspx">help prevent SQL injections</a> in your applications.
</p>
<blockquote>
When I've asked people about their strategies for preventing SQL injection, one response is sometimes "I use stored procedures." But, stored procedures do not, by themselves, necessarily protect against SQL injection. The usefulness of a stored procedure as a protective measure has everything to do with how the stored procedure is written. Write a stored procedure one way, and you can prevent SQL Injection. Write it another way, and you are still vulnerable. 
</blockquote>
<p>
The short answer is "not always" but he gets into a more detailed answer with a sample login script and the SQL to create the stored procedure the "wrong way" (using the value dynamically in the SQL of the procedure) and the "right way" (assigning them directly like bound variables).
</p>]]></description>
      <pubDate>Thu, 17 Feb 2011 11:46:14 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[9Lessons Blog: Stored Procedure Lesson]]></title>
      <guid>http://www.phpdeveloper.org/news/14742</guid>
      <link>http://www.phpdeveloper.org/news/14742</link>
      <description><![CDATA[<p>
On the 9Lessons blog today there's <a href="http://www.9lessons.info/2010/07/stored-procedure-lesson.html">a new post</a> looking at stored procedures - how to create them and how to use them from your PHP code.
</p>
<blockquote>
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.
</blockquote>
<p>
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.
</p>]]></description>
      <pubDate>Mon, 05 Jul 2010 09:17:06 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[EasyTech Blog: Executing PL/SQL code in Zend Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/11308</guid>
      <link>http://www.phpdeveloper.org/news/11308</link>
      <description><![CDATA[<p>
On the EasyTech blog, there's a <a href="http://blog.easytech.com.ar/2008/10/21/executing-plsql-code-in-zend-framework/">recent post</a> for Zend Framework developers out there working with the Oracle database showing how to execute PL/SQL code from your Zend_Db queries.
</p>
<blockquote>
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).
</blockquote>
<p>
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.
</p>]]></description>
      <pubDate>Wed, 29 Oct 2008 11:15:17 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[John Coggeshall's Blog: Alan has smoked too much PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/9058</guid>
      <link>http://www.phpdeveloper.org/news/9058</link>
      <description><![CDATA[<p>
In a <a href="http://blog.coggeshall.org/archives/337-Alan-has-smoked-too-much-PHP.html">new post</a> to his blog today, <i>John Coggeshall</i> comments on <a href="http://www.akbkhome.com/blog.php/View/155/PHPs_days_numbered.html">some thoughts</a> from <i>Alan Knowles</i> about a method for making PHP obsolete.
</p>
<blockquote>
Alan, I think you were smoking way too much PHP when you wrote this post.. This in particular really surprised me to hear you say [that a module that made mysql stored procedure calls based on a URL and returned JSON could make PHP obsolete]. While I do understand the concept your explaining, I simply can't see how the model is practical at all for two big reasons.
</blockquote>
<p>
His reasons involve not having a business case where an entire application is right there for the user to download and that its an insecure method for running an app.
</p>]]></description>
      <pubDate>Fri, 16 Nov 2007 07:58:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Maggie Nelson's Blog: How to (and how not to) pass an array from PHP to the database]]></title>
      <guid>http://www.phpdeveloper.org/news/8250</guid>
      <link>http://www.phpdeveloper.org/news/8250</link>
      <description><![CDATA[<p>
In a <a href="http://www.objectivelyoriented.com/2007/07/how_to_and_how_not_to_pass_an_1.html">new post</a> today, <i>Maggie Nelson</i> starts with the wrong way to do something - passing an array from PHP to a database - and works backward to make it all right.
</p>
<blockquote>
It would be really useful to have an easy way to pass arrays as bound parameters to queries or procedures from PHP. This would be especially useful if you're letting Oracle handle most of your data manipulating (as you should).
</blockquote>
<p>
She includes an example of how she's like it to work. Sadly, it doesn't but there are some ways that a developer could get close. Here's her process:
</p>
<ul>
<li>No queries in loops, please!
<li>In the ideal world...
<li>Put all your DML in stored procedures.
<li>str2tbl
<li>The list_pkg package
<li>list_pkg in your procedure
<li>list_pkg in your PHP
<li>Leveraging list_pkg
</ul>
<p>
The list_pkg is based around <a href="http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:110612348061">this article</a> from AskTom.
</p>]]></description>
      <pubDate>Mon, 16 Jul 2007 11:13:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[php|architect: Stored Procedure Programming for MySQL5 (Part 2)]]></title>
      <guid>http://www.phpdeveloper.org/news/5983</guid>
      <link>http://www.phpdeveloper.org/news/5983</link>
      <description><![CDATA[<p>
The A/R/T article repository (from php|architect) has posted the <a href="http://hades.phparch.com/ceres/public/article/index.php/art::mysql::sp_programming_mysql_5::part_2">second part of their series</a> covering stored procedure programming in MySQL by <i>Ligaya Turmelle</i>.
</p>
<blockquote>
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!
</blockquote>
<p>
Since they've <a href="http://www.phpdeveloper.org/news/5763">already gotten the groundwork laid</a> 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 <a href="http://hades.phparch.com/ceres/public/article/index.php/art::mysql::sp_programming_mysql_5::part_2/1">small gotchas</a> included to watch out for.
</p>]]></description>
      <pubDate>Tue, 08 Aug 2006 12:11:54 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[php|architect: Stored Procedure Programming for MySQL5 (Part 1)]]></title>
      <guid>http://www.phpdeveloper.org/news/5763</guid>
      <link>http://www.phpdeveloper.org/news/5763</link>
      <description><![CDATA[<p>
The php|architect A/R/T article repository has a new tutorial today, covering <a href="http://hades.phparch.com/ceres/public/article/index.php/art::mysql::sp_programming_mysql_5::part_1">stored procedure programming for MySQL</a> (by <i>Ligaya Turmelle</i>).
</p>
<blockquote>
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.
</blockquote>
<p>
They <a href="http://hades.phparch.com/ceres/public/article/index.php/art::mysql::sp_programming_mysql_5::part_1">cover </a> 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.
</p>]]></description>
      <pubDate>Mon, 10 Jul 2006 16:37:57 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Utah PHP Users Group: March 2006 Meeting - 16th @ 7pm]]></title>
      <guid>http://www.phpdeveloper.org/news/4859</guid>
      <link>http://www.phpdeveloper.org/news/4859</link>
      <description><![CDATA[The Utah PHP Users Group has posted a <a href="http://uphpu.org/calendar_event.php?eid=20060215125209199">new announcement</a> already about their March meeting to be held on the 16th.
<p>
This time, the topic is still a bit up in the air and they request that those attening vote on one of two - either "Ajax tools in Eclipse" or "postgresql + stored procedures" - but from <a href="http://uphpu.org/users.php?mode=profile&uid=48">Ray Hunter</a>. The meeting will be in the <a href="http://maps.google.com/maps?q=14944+Pony+Express+Rd,+Bluffdale,+UT+84065&spn=.103811,.163404&iwloc=A&hl=en">usual place</a>, the Linux Networx offices, and will get going around 7pm.
<p>
For more details on the group and this meeting, check out <a href="http://uphpu.org">their website</a>.]]></description>
      <pubDate>Fri, 17 Feb 2006 06:49:03 -0600</pubDate>
    </item>
  </channel>
</rss>
