473,383 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Notice: Trying to get property of non-object on execution of my code.

1
i have a php script for notifications, where i faced a problem with the non-object execution. i tried lot of googling but couldn't able to solve it out..

my code as follows::

Expand|Select|Wrap|Line Numbers
  1. <?php 
  2.                                 $sql = "SELECT * FROM input WHERE id =".$_GET["id"]; 
  3.                                 $result = mysqli_query ($conn,$sql);
  4.  
  5.                                 if ($result-> num_rows > 0) { 
  6.  
  7.                                 while($row -> $result->fetch_assoc()) { 
  8.  
  9.  
  10.                                 $myid = $row["id"] ;
  11.  
  12.                                 $sql2 = "SELECT * FROM output WHERE question_id = $myid ORDER BY date DESC";
  13.                                 $result2 = $conn->query($sql2);
  14.  
  15.                                 $sql3 = "SELECT COUNT(*) as rowCount FROM output WHERE question_id = '".$myid."'";
  16.                                 $result3 = $conn->query($sql3);
  17.                                 $rowCount= $result3->fetch_assoc();
  18.                             ?>
and the error show it on if ($result-> num_rows > 0) { ..

Any suggestions are appreicited..
Sep 15 '16 #1
1 1234
Dormilich
8,658 Expert Mod 8TB
Any suggestions are appreicited..
your query failed. it's as simple as that.
Sep 16 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: MilanB | last post by:
Hello What is the best way (or does it exists a way at all) to protect WinForm application from decompiling IL. Can it be full compiled yo windows native before distribution. And what is...
3
by: u473 | last post by:
How do I call a reusable report with a modifiable Rowsource property and or code ? Like in the following case where the table name will change any following day ? I am using Access 2003. ...
5
by: ronlahav | last post by:
Dear all i Wonder how can i edit a node property (in C# not by hand :) ) i have the follwing XMl file (hibernate.cfg.xml) <?xml version="1.0" encoding="utf-8" ?> <hibernate-configuration ...
0
by: iceborg | last post by:
Greetings, I have an application that was originally designed in Access 2000. It has been transformed to Access 2002 (XP), Access 2003, and now Access 2007. I have a form and subform, the...
6
by: ptmusthafa | last post by:
Dear All, I have a request that I am working with vb. What all I need is, Using a vb form am trying to change a field property of Access table ie. i want to change the property "Allow Zero Length"...
9
by: Briansmi1116 | last post by:
I downloaded a template off of the microsoft website, and I am trying to change this code: =nz()+nz()+CLng((nz()+nz())*nz()*100)/100 I want to get the sales tax to calculate to the Parts...
2
by: vizard | last post by:
Hi All, Im new to PHP. In the script I've written, i have the following line: if($coursesTaught->empId == $record- // do something } when the if condition executes, i get the foll message:...
2
by: new2c | last post by:
Hi - I'm completely new to C and trying to read some code that doesn't make sense to me. For proprietary reasons I can't display the code here but I'll describe it...and list part of it in a generic...
1
by: chakrod swapna | last post by:
hiiiiiii , im trying to write c code for imagedisplay,and at the basic stages i get struct of problem ' error: unknown type name ‘AnsiString’ ' plsssss help me...... my code is here: int...
0
by: gintare | last post by:
I am following Udemy course: https://www.udemy.com/introduction-to-web-development-with-symfony2/#/lecture/933836 There is Post model with several fields: title, author, body; which inherits...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.