• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Litle problem with big Variable


Help me please? I am studying PHP only 2 month.
I don't have a person that could help. And I've never seen any frameworks, except CI.

When I wrote in my mainpage controller:

$data= array;

it get me an error with the text below :

Undefined variable: page_id in

A have already switched the level of errors to lower, but still it doesn't work.

What's this all about?

P.S. : I'm from Ukraine, sorry for some troubles in English, that you might have note!!!
Thanks for help.

your $page_id variable is undefined.

try it first

echo $page_id;

if nothing print in your browser, you must defined the $page_id first, try example

$page_id = 1;

What I was trying to do is ...

I've tried to get the array of data from my SQL table.

Function "get" situated in model with name"crud" which extends CI_Model.

$page_id should get the info based on the query string that contain ciru2.ru/pages/show/index
I wanted $page_id to have "index" on it!!!

after those movements I've wrote




echo $page_id;

and what happening??

Thanks for the advice. I on my work right now. When get back home - I'll write what I get, cause my project is in my laptop.

Thank you "temon"... thank you a lot. I solved problem. But this was not even a problem , it was my inattentiveness )))

the row public function get()

should be

public function($page_id)

and construction switch case then works...

Sorry, I am beginner ... Lol


and in public function show($page_id)
switch ('page_id')
case 'index':

ha ha ha, you'r welcome!

you must give a complete code, if you want ask some think Big Grin

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.