Welcome Guest, Not a member yet? Register   Sign In
SQL errors
#1

[eluser]theknight[/eluser]
Here is my code:

$child = $this->getDetails($row['ParentOf_Id']);

which is in another function that calls a function called getdetails:

function getDetails($child_id=null,$limit=20){

// select all the fields in the children table
$this->db->select(castedColumns($this->children_table, $this->db));
//where the id is the child id
$q = $this->db->get_where($this->children_table, 'id='.$child_id);
//store results array in details
$details = $q->row_array();
I then get the following SQL error:

A Database Error Occurred Error Number:

Incorrect syntax near '='.

SELECT CAST(AdditionalNotes AS TEXT) as AdditionalNotes, CAST(DisabilitiesNotes AS TEXT) as DisabilitiesNotes, DOB, msrepl_tran_version FROM Children WHERE id=

Id does not get appended? why?

Been driving me nuts because, when I do echo $child_id; I get the child Id before passing it into the SQL.


Messages In This Thread
SQL errors - by El Forum - 03-14-2012, 08:35 AM
SQL errors - by El Forum - 03-14-2012, 01:21 PM
SQL errors - by El Forum - 03-14-2012, 03:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB