PDO prepeared statements PHP Call to undefined method PDO::execute() : <p>I am new to php mysqli ect and i have done my best to arrange a prepeared statement function to no avail. All i get is the following Error. </p>

<p>Call to undefined method PDO::execute() </p>

<p>I donnot understand why this is happening.</p>

<p>The values are being passed and echo'd but i still get this error. </p>

<p>It does not retrieve data from database either as error is called before doing so.</p>

<p>Can anybody see from the code what the problem is.. iv searched about on the net ect. and the closest i got what about checking the Isset of the inputs, but i had allready done this so thats not the issue.</p>

<p>im baffled.</p>

<p>Thanks for any advice... Its probly really simple. But so am i.</p>

<pre><code>&lt;?php

//include('conect.php')


$dbh = new PDO("mysql:host=localhost;dbname=classifieds", 'root', '');


$type=$_POST['type'];   
$price=$_POST['price']; 


if (isset($type) &amp;&amp; isset($price)) {

echo $type;
echo $price;

$dbh-&gt;prepare('SELECT * FROM testdata WHERE type=? AND price=?');
$stm = $dbh-&gt;execute(array($type, $price));

if(($row = $stm-&gt;fetchObject())) {

    $type=$row['type'];
    $price=$row['price'];

    echo $type; 
    echo $price;

} else 
    { echo "none recieved"; }

} else
    {echo "invalid"; }

?&gt;
</code></pre>
