Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>While you are switching, switch to PDO instead of mysqli, It helps you write database agnositc code and have better features for prepared statements.</p> <p><a href="http://www.php.net/pdo" rel="noreferrer">http://www.php.net/pdo</a></p> <p>Bindparam for PDO: <a href="http://se.php.net/manual/en/pdostatement.bindparam.php" rel="noreferrer">http://se.php.net/manual/en/pdostatement.bindparam.php</a></p> <pre><code>$sth = $dbh-&gt;prepare("SELECT * FROM tablename WHERE field1 = :value1 &amp;&amp; field2 = :value2"); $sth-&gt;bindParam(':value1', 'foo'); $sth-&gt;bindParam(':value2', 'bar'); $sth-&gt;execute(); </code></pre> <p>or: </p> <pre><code>$sth = $dbh-&gt;prepare("SELECT * FROM tablename WHERE field1 = ? &amp;&amp; field2 = ?"); $sth-&gt;bindParam(1, 'foo'); $sth-&gt;bindParam(2, 'bar'); $sth-&gt;execute(); </code></pre> <p>or execute with the parameters as an array:</p> <pre><code>$sth = $dbh-&gt;prepare("SELECT * FROM tablename WHERE field1 = :value1 &amp;&amp; field2 = :value2"); $sth-&gt;execute(array(':value1' =&gt; 'foo' , ':value2' =&gt; 'bar')); </code></pre> <p>It will be easier for you if you would like your application to be able to run on different databases in the future.</p> <p>I also think you should invest some time in using some of the classes from Zend Framwework whilst working with PDO. Check out their <a href="http://framework.zend.com/manual/en/zend.db.html#zend.db.adapter.connecting.factory" rel="noreferrer" title="Zend_DB_Factory">Zend_Db</a> and more specifically [Zend_Db_Factory][2]. You do not have to use all of the framework or convert your application to the MVC pattern, but using the framework and reading up on it is time well spent.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload