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
Call to a member function fetch_assoc() on a 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="Markshall" data-source="post: 373351" data-attributes="member: 1872"><p>It's because you're trying to get the array from your row count</p><p></p><p>$hit is your row count</p><p></p><p>Change</p><p>[php]$take = $hit->fetch_assoc();[/php]</p><p>To</p><p>[php]$take = $connect->fetch_assoc();[/php]</p><p></p><p>Side note; you may want to think about aptly naming your variables. $connect isn't a suitable name for what it is actually doing.</p><p></p><p>Another side note: look into escaping/sanitising your inputs. Someone could quite easily hack your website through SQL injections with that code you're using.</p></blockquote><p></p>
[QUOTE="Markshall, post: 373351, member: 1872"] It's because you're trying to get the array from your row count $hit is your row count Change [php]$take = $hit->fetch_assoc();[/php] To [php]$take = $connect->fetch_assoc();[/php] Side note; you may want to think about aptly naming your variables. $connect isn't a suitable name for what it is actually doing. Another side note: look into escaping/sanitising your inputs. Someone could quite easily hack your website through SQL injections with that code you're using. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
Call to a member function fetch_assoc() on a non-object
Top