<?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>Thu, 23 May 2013 13:54:21 -0500</pubDate>
    <ttl>30</ttl>
    <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>
  </channel>
</rss>
