![]() |
|
[PHP] Not getting any rows search engine - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183) +---- Thread: [PHP] Not getting any rows search engine (/showthread.php?tid=5905401) |
Not getting any rows search engine - deadsh0t - Nov 9, 2018 so i got a form on a page to search and i made a search engine that gos to search.php however i keep getting 0 rows so it displays nothing found what i tried: PHP Code PHP Code PHP Code But i keep getting 0 rows even when i type the exact title Okay im now really confused so i started from scratch and now this: PHP Code shows all rows from my database UPDATE: So i got it to work using mysqli by using this : PHP Code however i would still like to know how to get it to work in PDO RE: Not getting any rows search engine - Vuln - Nov 9, 2018 The query syntax is fine. Do other queries fail as well? RE: Not getting any rows search engine - FoxBlood - Nov 9, 2018 Maybe the bug isn't in your sql, check if you get the post request variabled. Why you didn't use PDO? RE: Not getting any rows search engine - deadsh0t - Nov 9, 2018 (Nov 9, 2018 04:28 AM)Jailbyte Wrote: The query syntax is fine. Do other queries fail as well? (Nov 9, 2018 04:38 AM)FoxBlood Wrote: Maybe the bug isn't in your sql, check if you get the post request variabled. Why you didn't use PDO? The post variable is fine because i echo it and it displays i dont use pdo cause i never used it before but i might consider using it . If i remove the where clause it puts out every row but as soon as i put the where clause there and type a letter or even the identical title of 1 of the rows it still displays nothing and the row count is 0 (Nov 9, 2018 04:38 AM)FoxBlood Wrote: Maybe the bug isn't in your sql, check if you get the post request variabled. Why you didn't use PDO? tried pdo doesnt work with this : PHP Code RE: Not getting any rows search engine - TCP - Nov 9, 2018 (Nov 9, 2018 07:04 AM)deadsh0t Wrote: The post variable is fine because i echo it and it displays i dont use pdo cause i never used it before but i might consider using it . Don't mix mysqli and pdo PHP Code What do you get with this? RE: Not getting any rows search engine - deadsh0t - Nov 9, 2018 (Nov 9, 2018 07:41 AM)Exp500 Wrote: Don't mix mysqli and pdo that shows nothing 0 rows RE: Not getting any rows search engine - TCP - Nov 9, 2018 (Nov 9, 2018 07:44 AM)deadsh0t Wrote: that shows nothing 0 rows Can you show us the torrents table and the value of torrent? RE: Not getting any rows search engine - FoxBlood - Nov 9, 2018 (Nov 9, 2018 07:04 AM)deadsh0t Wrote: The post variable is fine because i echo it and it displays i dont use pdo cause i never used it before but i might consider using it . what? use pdo and prepare statement like this: PHP Code RE: Not getting any rows search engine - deadsh0t - Nov 9, 2018 (Nov 9, 2018 07:46 AM)Exp500 Wrote: Can you show us the torrents table and the value of torrent? PHP Code
RE: Not getting any rows search engine - TCP - Nov 9, 2018 (Nov 9, 2018 07:52 AM)deadsh0t Wrote: The value of rows and $torrent var? Did you initialize PDO correctly? RE: Not getting any rows search engine - deadsh0t - Nov 9, 2018 i initialised the PDO like this: PHP Code $torrent var get the post value torrent wich is the name of a text input on a form on the index page that looks like this: PHP Code ![]() UPDATE: So i got it to work using mysqli by using this : PHP Code however i would still like to know how to get it to work in PDO RE: Not getting any rows search engine - Squito - Nov 9, 2018 UTF8 queries executed on latin1 fields? Here's an example of using MySQLi prepared statement: PHP Code |