Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
PHP Error: Trying to get property of non-object
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Berk" data-source="post: 406015" data-attributes="member: 63611"><p>ellor.</p><p>so i am trying to get data from database using mysql. (im old minded ye.)</p><p>so error is</p><p>Notice: Trying to get property of non-object in C:\xampp\htdocs\odev\index.php on line 91</p><p>fetch code:</p><p>[PHP] <div class="row text-center"></p><p><?php require_once("ayarlar/ayar.php"); $sql = "SELECT * FROM yemekler ORDER BY id DESC";</p><p>$result = mysql_query($sql);</p><p></p><p>if ($result->num_rows > 0) {</p><p> // output data of each row</p><p> while($row = $result->fetch_assoc()) {</p><p> echo ' <div class="col-md-3 col-sm-6 hero-feature"></p><p> <div class="thumbnail"></p><p> <img src=" '. $row["resimlink"] . '" alt=""></p><p> <div class="caption"></p><p> <h3> ' . ucwords($row["ad"]) . ' </h3></p><p> <p>' . $row['yore'] . ' yöresine ait muhteşem yemek! </p></p><p> <p></p><p> <a href="http://localhost/odev/yemek.php?id=' . $row["id"] . '" class="btn btn-primary">Buy Now!</a> <a href="#" class="btn btn-default">More Info</a></p><p> </p></p><p> </div></p><p> </div></p><p> </div>';}}?>[/PHP]</p></blockquote><p></p>
[QUOTE="Berk, post: 406015, member: 63611"] ellor. so i am trying to get data from database using mysql. (im old minded ye.) so error is Notice: Trying to get property of non-object in C:\xampp\htdocs\odev\index.php on line 91 fetch code: [PHP] <div class="row text-center"> <?php require_once("ayarlar/ayar.php"); $sql = "SELECT * FROM yemekler ORDER BY id DESC"; $result = mysql_query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo ' <div class="col-md-3 col-sm-6 hero-feature"> <div class="thumbnail"> <img src=" '. $row["resimlink"] . '" alt=""> <div class="caption"> <h3> ' . ucwords($row["ad"]) . ' </h3> <p>' . $row['yore'] . ' yöresine ait muhteşem yemek! </p> <p> <a href="http://localhost/odev/yemek.php?id=' . $row["id"] . '" class="btn btn-primary">Buy Now!</a> <a href="#" class="btn btn-default">More Info</a> </p> </div> </div> </div>';}}?>[/PHP] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
PHP Error: Trying to get property of non-object
Top