Welcome Guest, Not a member yet? Register   Sign In
help .... I got a FATAL ERROR -- probably syntax
#21

[eluser]Thorpe Obazee[/eluser]
[quote author="SpooF" date="1243584907"]
Quote:================================================
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: query
Filename: views/blog_view.php
Line Number: 8
=================================================

Was that always being displayed?[/quote]

Tongue

I believe that was always displayed and he never said anything about it. <-- something I'm thinking of saying.
#22

[eluser]SpooF[/eluser]
The user guide is updated with each new release of Codeigniter.

I think the user guide is the best place to start. If you look at the Codeigniter home page you will see how they order the links.

[Image: http://travisperson.com/wp-content/uploa...mepage.jpg]

A few of your problem could of been easily solved if you read the user guide first. Also the user guide is the most update resource you can get.
#23

[eluser]SpooF[/eluser]
[quote author="bargainph" date="1243585898"][quote author="SpooF" date="1243584907"]
Quote:================================================
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: query
Filename: views/blog_view.php
Line Number: 8
=================================================

Was that always being displayed?[/quote]

Tongue

I believe that was always displayed and he never said anything about it. <-- something I'm thinking of saying.[/quote]

That would be my guess to.

That error is telling you that your not defining the query variable. Thats why your getting Fatal error: Call to a member function result() on a non-object.
#24

[eluser]JPrieto[/eluser]
yes and no

sometimes it displayed and other times it does not
thats when i was trying different syntax 9spaces, colon, semicolo, etc)
the times it did, it is true i failed to mention - but the errors where taken cared of

right now it displays
#25

[eluser]Thorpe Obazee[/eluser]
[quote author="JPrieto" date="1243587039"]yes and no

sometimes it displayed and other times it does not
thats when i was trying different syntax 9spaces, colon, semicolo, etc)
the times it did, it is true i failed to mention - but the errors where taken cared of

right now it displays[/quote]

Next time, you say everything.... Smile
#26

[eluser]JPrieto[/eluser]
i just read this post
http://ellislab.com/forums/viewthread/45812/P0/
these people were familiar with the user guide
not even by the end of the post did they solved it

just curious
from those replying, were you able to duplicate tutorial video 2 in your local pc or mac?

cause those who did are better able to understand this issue

thanks guys, but i know there got to be a solution

i just viewed the video 2 again
i got everything exactly as they coded in the video

please ... lets find the bug

thanks
#27

[eluser]Thorpe Obazee[/eluser]
[quote author="JPrieto" date="1243588385"]i just read this post
http://ellislab.com/forums/viewthread/45812/P0/
these people were familiar with the user guide
not even by the end of the post did they solved it

just curious
from those replying, were you able to duplicate tutorial video 2 in your local pc or mac?

cause those who did are better able to understand this issue

thanks guys, but i know there got to be a solution

i just viewed the video 2 again
i got everything exactly as they coded in the video

please ... lets find the bug

thanks[/quote]

1. I never duplicated any the video tutorials.
2. Problems are often solved by actually giving 'all' or 'most' of the facts
#28

[eluser]SpooF[/eluser]
The user guide tells you how to use Codeigniter and how it acts, it doesn't tell you how to solve every problem.

Also that thread is not discussing an error or really a problem. They are talking about how they think code igniter should act. The documentation is very clear, and it does exactly what it says it will do. Return false if no results are gathered.

If you think the user guide is pointless you dont have to read it, but you'll find that most people will direct you to it when you ask a question that is simple answered by looking at the user guide.

If you want I can setup and entire codeigniter installation that works on my system and then send it to you with detailed instruction on how to set it up.

Other wise, every time you run into a bug I would like you to supply the full source of the files. In this case, the blog controller and blog_view.
#29

[eluser]JPrieto[/eluser]
[quote author="SpooF" date="1243589405"]
If you want I can setup and entire codeigniter installation that works on my system and then send it to you with detailed instruction on how to set it up.
[/quote]

no, no -- that would be abusing your generosity
i don't want you to do all that work for me
but i am very humbled by your sincerity in helping me

here are the files code
===========================
controller blog.php
============================
Code:
&lt;?php
Class Blog extends Controller
{
    Function Blog()
    {
        parent::Controller();
    }
    
    Function index()
    {
       $data['title']= "My Blog Title";
       $data['heading']= "My Blog Heading";
       $data['query']= $this->db->get('entries');
       $this->load->view('blog_view',$data);
    }
}
?&gt;

=========================
views file blog_view.php
=========================
Code:
&lt;html&gt;
&lt;head&gt;
  &lt;title&gt;&lt;?php echo $title; ?&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;

<h1> &lt;?php echo $heading; ?&gt; </h1>
&lt;?php foreach($query->result() as $row ): ?&gt;

<h3>&lt;?php echo $row->title; ?&gt;</h3>
<p>&lt;?php echo $row->body; ?&gt;</p>
<hr>
&lt;?php endforeach; ?&gt;

&lt;/body&gt;
&lt;/html&gt;

==========================================
error message displayed in my browser
===========================================
...............................................................
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: query
Filename: views/blog_view.php
Line Number: 8
..................................................................

Fatal error: Call to a member function result() on a non-object in
C:\wamp\www\codeigniter\system\application\views\blog_view.php on line 8



======================
line 8
========================
Code:
&lt;?php foreach($query->result() as $row ): ?&gt;


.............. and that's it

what do you think?
#30

[eluser]JPrieto[/eluser]
still...

has anyone been able to duplicate tutorial video 2
with the current version of CI and a server with PHP5

??

just curious

if not, try to duplicate it, and see if it works well for you

there will always be newbies to ci who will try to duplicate the tutorial videos

and my many bugs will certainly be theirs too

trust me -- try the tutorial video yourselves

and see what happens

please




Theme © iAndrew 2016 - Forum software by © MyBB