Welcome Guest, Not a member yet? Register   Sign In
Search Results
    Thread: Syntax in function does not work
Post: RE: Syntax in function does not work

WOW ...This boy knows what says :-) GREAT, I understand. Thanks very much. ..but I will be to have more questions later :-) Thanks very much for best practise..
24,005 Views
0 Replies
12-01-2014, 04:14 PM
lkudlacek
    Thread: Syntax in function does not work
Post: RE: Syntax in function does not work

I apologise, I am beginner with CodeIgniter. Your example works...but I must define a controller. I try it clarify again. 1) Download current version CodeIgniter 2) Define your application/con...
24,005 Views
0 Replies
12-01-2014, 02:22 PM
lkudlacek
    Thread: Syntax in function does not work
Post: RE: Syntax in function does not work

Rufnex Wrote: (11-29-2014, 05:25 PM) -- You have no class defined, so you cannot use the this keyword. This is the way to build a controller (but the db stuff should come from a model). PHP Cod...
24,005 Views
0 Replies
11-29-2014, 05:36 PM
lkudlacek
    Thread: Syntax in function does not work
Post: RE: Syntax in function does not work

Rufnex Wrote: (11-29-2014, 05:10 PM) -- You have called the row() method wrong, try this: PHP Code: -- function test() {  $test = $this->db->query("SELECT name FROM users");  $name = $tes...
24,005 Views
0 Replies
11-29-2014, 05:16 PM
lkudlacek
    Thread: Syntax in function does not work
Post: RE: Syntax in function does not work

Rufnex Wrote: (11-29-2014, 04:54 PM) -- Ok, have you loaded the database library in you config or in your controller? -- I call database from this command on main page/file (header.php) and it work...
24,005 Views
0 Replies
11-29-2014, 05:00 PM
lkudlacek
    Thread: Syntax in function does not work
Post: RE: Syntax in function does not work

Rufnex Wrote: (11-29-2014, 04:50 PM) -- Where do you call this function. You have to put it in a Model or in a Controller. Did you do this? -- The page is defined in Controller.
24,005 Views
0 Replies
11-29-2014, 04:53 PM
lkudlacek
    Thread: Syntax in function does not work
Post: RE: Syntax in function does not work

Ok...so..for example does not work this: function test() {   $test = $this->db->query("SELECT name FROM users");   $name = $query->row()->name;   return $name; } This example WORKS: funct...
24,005 Views
0 Replies
11-29-2014, 04:41 PM
lkudlacek
    Thread: Syntax in function does not work
Post: RE: Syntax in function does not work

I don`t have problem with query. It works me. I have a problem with query in FUNCTION(). function test() { $query = $this->db->query("YOUR QUERY"); if ($query->num_rows() > 0) { $row...
24,005 Views
0 Replies
11-29-2014, 12:31 PM
lkudlacek
    Thread: Syntax in function does not work
Post: Syntax in function does not work

Hi, I have the problem with CodeIgniter syntax in function. It works: $value = $this->db->query("SELECT * FROM `z_kinds`"); echo $value; It does not work: function value() { $valu...
24,005 Views
0 Replies
11-29-2014, 09:23 AM
lkudlacek

Theme © iAndrew 2016 - Forum software by © MyBB