Welcome Guest, Not a member yet? Register   Sign In
how to use regular pdo in CI
#1

[eluser]Unknown[/eluser]
i am used to writing regular pdo statements into php how can i continue doing that without having to learn active records or use whatever else method there is in CI

i did something like this


Code:
$sql = "select column1,column2 from table where column_id = :column_id and column_2 = :something"
$query = $db->query($sql);
$query->bindParam(":column_id", $_GET['value'], PDO::PARAM_INT);
$query->bindParam(":something", $_GET['something'], PDO::PARAM_STR);
$query->execute();

while($row = $query->fetch(PDO::FETCH_OBJ)
{
   print $row->data;
}

//rather than using $_GET i can probably use $this->uri->segment() which hopefully works with this...

how can i implement what i am already used to??


thanks




Theme © iAndrew 2016 - Forum software by © MyBB