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] Why will my value not display?
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="TesoMayn" data-source="post: 466246" data-attributes="member: 8605"><p>In my opinion, it's a poor habit to put your entire site inside an echo.</p><p></p><p>As for your PHP a simple fix is to replace</p><p>[code=php]</p><p>$GetProperty = mysqli_query("SELECT id,img,beds FROM properties WHERE id > 0 ORDER by id");</p><p>[/code]</p><p>with</p><p>[code=php]</p><p>$GetProperties = mysqli_query($mysqli, "SELECT id,img,beds FROM properties WHERE id > 0 ORDER by id");</p><p>$GetProperty = mysqli_fetch_assoc($GetProperties);</p><p>[/code]</p><p>Or if you wish to do it in one line:</p><p>[code=php]</p><p>$GetProperty = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT id,img,beds FROM properties WHERE id > 0 ORDER by id"));</p><p>[/code]</p><p>You should also consider using OOP instead of procedural, or even switch to a framework such as Laravel</p></blockquote><p></p>
[QUOTE="TesoMayn, post: 466246, member: 8605"] In my opinion, it's a poor habit to put your entire site inside an echo. As for your PHP a simple fix is to replace [code=php] $GetProperty = mysqli_query("SELECT id,img,beds FROM properties WHERE id > 0 ORDER by id"); [/code] with [code=php] $GetProperties = mysqli_query($mysqli, "SELECT id,img,beds FROM properties WHERE id > 0 ORDER by id"); $GetProperty = mysqli_fetch_assoc($GetProperties); [/code] Or if you wish to do it in one line: [code=php] $GetProperty = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT id,img,beds FROM properties WHERE id > 0 ORDER by id")); [/code] You should also consider using OOP instead of procedural, or even switch to a framework such as Laravel [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
[PHP] Why will my value not display?
Top