Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6532453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:00:16+00:00 2026-05-25T10:00:16+00:00

i have a beginner question. Im making a video site. I store the data

  • 0

i have a beginner question.

Im making a video site.

I store the data in my database about the videos.

And i have a bit of a problem.

I would like to load the video embed by title and im doing something wrong.

the model

function load_video()
{
    $q = $this->db->get_where('videos', array('title' => $title), 1);
    if($q->num_rows() > 0) {
        foreach($q->result() as $row) {
            $vids[] = $row;
        }
        return $vids;
    }


} 

here is the main page view, and the anchore wich i sopose to click it would show the video

foreach ($results as $r) {

        echo '<div class="video_box">';
            echo '<p>' . substr($r->title, 0, 16) . "..." . " </p>";
            $thumbnail = array('src' => $r->thumbnail, 'title' => $r->title,);
            echo "<a href='index.php/video/play/".$r->title."'>" . img($thumbnail) . "</a>";
            echo '<div class="duration">'.(round($r->duration / 60)).':' . ''.(round($r->duration % 60)).'</div>';
        echo '</div>';
    }
?>

and here is the video controller

function play($title){
        $this->load->model('video_model');
        $data['results'] = $this->video_model->load_video();
        $this->load->view("video_page", $data);
    }

and im always getting this error

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: title

Filename: models/video_model.php

Line Number: 49

could please someone point out what im doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:00:17+00:00Added an answer on May 25, 2026 at 10:00 am

    You dont load the variable/string inside your model?

    If you use it in your database query yo should also send it? 🙂

    In controller send it to model:

        $this->video_model->load_video($title);
    

    In model we include it in the function:

        function load_video($title)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Absolute beginner question: I have a template file index.html that looks like this: ...
Bit of a beginner question here: Say I have a block of xml: <root>
Beginner here, I have a simple question. In Android what would be the best
Total beginner question about jQuery: I have a Form that contains several TextBoxes (input
I have a beginner question about dates and String in Haskell. I need to
I have a beginner's question about releasing variables and not wasting memory... I don't
I have a beginner's question. I was wondering about the level of subviews and
A beginner question... I have a list like this: x <- c(aa=v12, bb=x21, cc=f35,
This seems like a pretty beginner question; however, I have no idea what the
This is kind of a beginner question. For now I have the implementation like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.