CodeIgniter Forums

Full Version: Is this codeigniter SQL syntax
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]theknight[/eluser]
$this->db->select(castedColumns($this->contacts_table, $this->db));

I have this within a web application that also uses mem cache. It dislikes the syntax, and after looking at the user guide, there seems to be no mention of this exact syntax.

Thanks.

El Forum

[eluser]johnpeace[/eluser]
[quote author="theknight" date="1331141892"]$this->db->select(castedColumns($this->contacts_table, $this->db));

I have this within a web application that also uses mem cache. It dislikes the syntax, and after looking at the user guide, there seems to be no mention of this exact syntax.

Thanks.
[/quote]

If the function castedColumns($this->contacts_table, $this->db) returns a string naming one of the fields you want to select...then it's valid...though not the way most of us would do it.

This is at very least incomplete though...$this->db->select() on it's own isn't going to produce anything. Select it from where? Do what with it? Any results?

El Forum

[eluser]theknight[/eluser]
Full code

$this->db->select(castedColumns($this->contacts_table, $this->db));

$conditions = array('Email' => $username);
if (!$ignore_password) {
$conditions['SaltedAndHashedPortalPassword'] = $password;
}
$q = $this->db->get_where($this->contacts_table, $conditions);

$res = $q->row_array();

El Forum

[eluser]johnpeace[/eluser]
That could work...what error are you getting?

El Forum

[eluser]theknight[/eluser]
blank screen after this:

$this->db->select(castedColumns($this->contacts_table, $this->db));

when I completely remove memcaching.

El Forum

[eluser]johnpeace[/eluser]
What is this:

Code:
castedColumns($this->contacts_table, $this->db)

Where is that function declared?

El Forum

[eluser]InsiteFX[/eluser]
25 posts and you still do not know how to use code tags!