Extract database value


I have a very simple issue.

  • User enters email , the clicks button

  • Using Ajax, I check if the email exists or not in db, if it does, I retrieve corresponding username from the database.

I am ABLE to compare the user input against database but UNABLE to retrieve the username corresponding to email(the bold part below).

[i]My controller code is




	        $criteria=new CDbCriteria;

		$criteria->select='email';  // only select the 'title' column





		[u][b]if ($model2!=NULL)





			 $this->renderPartial('_task', array('username'=>$username));




_task code


<div class="tasks">

<?php echo $username; ?>




It seems like you are not retrieving the "username" from the DB

$criteria->select=‘email, username’; // only select the ‘title’ column


$criteria->select you were only selecting email, username was not being retrieved.

This should work now.

I did this. Its WORKING. Thanks!!!

Glad to hear… ;)