Click here to Skip to main content
15,442,639 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
GeneralRe: what is the error : SQL syntax; check the manual that corresponds to your MariaDB server version? Pin
Amir karim3-Apr-19 21:24
MemberAmir karim3-Apr-19 21:24 
GeneralRe: what is the error : SQL syntax; check the manual that corresponds to your MariaDB server version? Pin
Richard Deeming3-Apr-19 22:28
mveRichard Deeming3-Apr-19 22:28 
QuestionStored procedure is needed Pin
Member 1246113225-Mar-19 4:02
MemberMember 1246113225-Mar-19 4:02 
AnswerRe: Stored procedure is needed Pin
Richard MacCutchan25-Mar-19 5:40
mveRichard MacCutchan25-Mar-19 5:40 
QuestionHow to call php divisions by a button click Pin
Member 1417791010-Mar-19 22:54
MemberMember 1417791010-Mar-19 22:54 
QuestionDEVELOPING WEB FORM Pin
Member 1402329817-Oct-18 5:40
MemberMember 1402329817-Oct-18 5:40 
AnswerRe: DEVELOPING WEB FORM Pin
Mycroft Holmes17-Oct-18 12:43
professionalMycroft Holmes17-Oct-18 12:43 
QuestionWhy my field returns boolean instead of object? Pin
Member 1399562824-Sep-18 3:12
MemberMember 1399562824-Sep-18 3:12 
Hi. I'm new at php oop, and I have a question.

I have this method in my class:

PHP
public function find($user = null) {
		if ($user) {
			$field = (is_numeric($user)) ? 'id' :'username';
			$data = $this->_db->get('users', array($field, '=', $user));
			//var_dump($data);
			//die();

			if ($data->count()) {
				
				$this->_data = $data->first();
				return true;
			}
		}
		return false;
	}


When I call class function count() I got message:

Call to a member function count() on a non-object


I understand that $data isn't an object:
var_dump($data); returns boolean false????
AnswerRe: Why my field returns boolean instead of object? Pin
Graham Breach24-Sep-18 3:48
MemberGraham Breach24-Sep-18 3:48 
GeneralRe: Why my field returns boolean instead of object? Pin
Member 1399562824-Sep-18 3:50
MemberMember 1399562824-Sep-18 3:50 
GeneralRe: Why my field returns boolean instead of object? Pin
Graham Breach24-Sep-18 4:57
MemberGraham Breach24-Sep-18 4:57 
AnswerRe: Why my field returns boolean instead of object? Pin
SiFinances28-Oct-18 0:52
MemberSiFinances28-Oct-18 0:52 
Questionhow to find daily cash book record from two tables with php mysql Pin
Faruk Web10-Aug-18 21:46
MemberFaruk Web10-Aug-18 21:46 
QuestionGet data attribute from an array of select box Pin
Member 85505912-Aug-18 16:23
MemberMember 85505912-Aug-18 16:23 
QuestionHow to allow access to a yii web application for specific users using .htaccess Pin
Member 139352711-Aug-18 23:20
MemberMember 139352711-Aug-18 23:20 
AnswerRe: How to allow access to a yii web application for specific users using .htaccess Pin
Richard MacCutchan2-Aug-18 0:40
mveRichard MacCutchan2-Aug-18 0:40 
AnswerRe: How to allow access to a yii web application for specific users using .htaccess Pin
Richard MacCutchan2-Aug-18 1:31
mveRichard MacCutchan2-Aug-18 1:31 
GeneralRe: How to allow access to a yii web application for specific users using .htaccess Pin
Member 139352712-Aug-18 1:35
MemberMember 139352712-Aug-18 1:35 
GeneralRe: How to allow access to a yii web application for specific users using .htaccess Pin
Richard MacCutchan2-Aug-18 3:49
mveRichard MacCutchan2-Aug-18 3:49 
GeneralRe: How to allow access to a yii web application for specific users using .htaccess Pin
Member 1393527114-Aug-18 1:02
MemberMember 1393527114-Aug-18 1:02 
GeneralRe: How to allow access to a yii web application for specific users using .htaccess Pin
Member 1393527114-Aug-18 1:02
MemberMember 1393527114-Aug-18 1:02 
QuestionHow Can I Start Learning PHP Pin
Andre Hoss3-Jul-18 7:03
MemberAndre Hoss3-Jul-18 7:03 
AnswerRe: How Can I Start Learning PHP Pin
Richard MacCutchan3-Jul-18 8:27
mveRichard MacCutchan3-Jul-18 8:27 
AnswerRe: How Can I Start Learning PHP Pin
Member 1501179923-Dec-20 7:29
MemberMember 1501179923-Dec-20 7:29 
Questionphp-mysql Pin
Raja Jee2-Jul-18 18:38
MemberRaja Jee2-Jul-18 18:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.