Welcome Guest, Not a member yet? Register   Sign In
MySQL Data Retrieval
#4

[eluser]naren_nag[/eluser]
Are you building a library/plugin for ORM? Check out Datamapper or Datamapper Overzealous Edition to see how Stensi and Phil have implemented this.

And if you're writing your model like this ... dude, wtf!

Code:
function get($id)
{
$query = $this->db->where("id",$id)->from("tablename")-get();

if($query->num_rows() > 0)
   return $query->row()  // or return true and populate the model's public variables
else
  return false
}

Perhaps if you help me understand WHY you're writing the code you're writing, I'll be able to move away from the WTF zone and answer better Smile

naren


Messages In This Thread
MySQL Data Retrieval - by El Forum - 06-17-2009, 11:12 AM
MySQL Data Retrieval - by El Forum - 06-17-2009, 11:58 AM
MySQL Data Retrieval - by El Forum - 06-17-2009, 05:19 PM
MySQL Data Retrieval - by El Forum - 06-17-2009, 11:51 PM
MySQL Data Retrieval - by El Forum - 06-18-2009, 02:16 AM
MySQL Data Retrieval - by El Forum - 07-01-2009, 01:03 PM



Theme © iAndrew 2016 - Forum software by © MyBB