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 9256207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:53:12+00:00 2026-06-18T11:53:12+00:00

I use Yii, and I get this error; What should I understand and do?

  • 0

I use Yii, and I get this error; What should I understand and do?

Not a duplicate of: source or any other;

error is at: ->bindParam(":url_id", $url->id)

$url = Url::model()->findByAttributes(array('link' => $_url));
        if (empty($url)) {
            $url = new Url();
            $url->website_id = $website->id;
            $url->link = $_url;
            $url->title = '';
            $url->description = '';
            $url->doctype = $_doctype;
            $url->visits = 1;
            $url->created = date('Y-m-d h:i:s',time());
            $url->updated = date('Y-m-d h:i:s',time());
            $url->status = 1;
            $url->save(false);
        } else {
            // update visits
            $url->saveCounters(array('visits' => 1));
            // url existed, let's load products
            if (!Yii::app()->user->isGuest) {
                $sql = "select u.id from url as u
                    left join url_follower as u_f
                    on u.id = u_f.url_id and u_f.user_id = :user_id
                    where u.id =:url_id";
                $cmd = Yii::app()->db->createCommand($sql)
                        ->bindParam(":url_id", $url->id)
                        ->bindParam(":user_id", Yii::app()->user->id);
                $url_id = $cmd->queryScalar();
  • 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-06-18T11:53:14+00:00Added an answer on June 18, 2026 at 11:53 am

    The solution, tested:

    $user_id = Yii::app()->user->id;
                    $url_id = $url->id;
                    $cmd = Yii::app()->db->createCommand($sql)
                            ->bindParam(":user_id", $user_id)
                            ->bindParam(":url_id", $url_id);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try update num_of_gifts without select use yii active record and CDbCriteria this is
I use yii framework to create map application.In this application i use GeoExt and
Trying to use modules in Yii and want to get access from main controller
I use yii with postrgres. Is it possible to get the next (or current)
I'm building a web application and eventually would want to use Yii framework. But
I am confused as to how to use CSort in Yii for a drag
I use subversion to manage my yii website (php framework) and have separate backend
I'm trying to figure out a way to re-use the validation rules of Yii's
I use Yii framework to develop a website, I want to know how to
I use a php framework (Yii) for my code which includes jquery.js in each

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.