Welcome Guest, Not a member yet? Register   Sign In
PDO in Codeigniter
#9

[eluser]Chad Fulton[/eluser]
Your problem here is that you haven't assigned the prepared statement to a variable. You need to call bindParam on the prepared statement variable, rather than on the PDO object itself.

Code:
//dummy variable
$pass_thru = 5;

$stmt = $this->db->prepare("SELECT * FROM tbl_blog WHERE blog_id <= :test");
$stmt->bindParam(':test', $pass_thru, PDO::PARAM_INT);
$data = $this->db->execute();

return $data;

At this point, you're pretty much using the raw PDO class, so your best bet for documentation is the PHP Manual for PDO.


Messages In This Thread
PDO in Codeigniter - by El Forum - 07-02-2009, 01:05 PM
PDO in Codeigniter - by El Forum - 07-02-2009, 01:12 PM
PDO in Codeigniter - by El Forum - 07-02-2009, 01:44 PM
PDO in Codeigniter - by El Forum - 07-02-2009, 03:20 PM
PDO in Codeigniter - by El Forum - 07-03-2009, 04:09 PM
PDO in Codeigniter - by El Forum - 07-04-2009, 09:42 AM
PDO in Codeigniter - by El Forum - 07-04-2009, 10:20 AM
PDO in Codeigniter - by El Forum - 07-06-2009, 11:35 AM
PDO in Codeigniter - by El Forum - 07-06-2009, 12:02 PM
PDO in Codeigniter - by El Forum - 07-06-2009, 12:22 PM
PDO in Codeigniter - by El Forum - 07-06-2009, 12:31 PM
PDO in Codeigniter - by El Forum - 07-06-2009, 12:39 PM
PDO in Codeigniter - by El Forum - 07-06-2009, 12:53 PM



Theme © iAndrew 2016 - Forum software by © MyBB