Postgresql and PHP prepared statements
<p>Im trying to insert information into my postgres database using prepared statements. I know about the pg-prepare statement, my question is what is the equivalent to bindParam for postgresql? Maybe I'm misunderstanding how it all connects.</p>

<p>I've done the equivalent in mysql:</p>

<pre><code>$stmt = $pdo-&gt;prepare("INSERT INTO users (name, position) VALUES (:name, :position)");
$stmt-&gt;bindParam(':name', $fname, PDO::PARAM_STR);
$stmt-&gt;bindParam(':position', $pos, PDO::PARAM_STR);
$stmt-&gt;execute();
</code></pre>

<p>Postgresql seems to have its own set of statements to use like <a href="http://php.net/manual/en/function.pg-prepare.php" rel="nofollow noreferrer">pg_prepare</a>, <a href="http://us2.php.net/manual/en/function.pg-insert.php" rel="nofollow noreferrer">pg_insert</a>, pg_select, and pg_execute. I don't understand how they all work together. The us2[.]php.net/manual site doesn't have enough information.</p>

<p>I try to get started with insert, but then get lost when it comes to binding. They only have examples for selection.</p>

<pre><code>$result = pg_insert($pdo, "query", '');
</code></pre>

<p>Any help would be appreciated.</p>