Welcome Guest, Not a member yet? Register   Sign In
no result for simple queries
#1

[eluser]xwero[/eluser]
I didn't know if this is a bug or a design decision so i posted it here.

i was playing with the mysql functions and i discovered
Code:
$query = $this->db->query('select DAYOFWEEK('.$year.'-'.$month.'-'.$day.') as nr');
$row = $query->row();
echo $query->num_rows();
echo $row->nr;
nr doesn't display anything eventhough the num_rows method displays 1.

Is there a workaround to display this sort of query results or do i have to use the native php functions for this?
#2

[eluser]xwero[/eluser]
ok i solved the problem.

Code:
$query = $this->db->query('select DAYOFWEEK('.$year.'-'.$month.'-'.$day.') as nr');

had to be

Code:
$query = $this->db->query('select DAYOFWEEK("'.$year.'-'.$month.'-'.$day.'") as nr');

what a rookie mistake.




Theme © iAndrew 2016 - Forum software by © MyBB