Tokugawa Posted July 24, 2019 Share Posted July 24, 2019 Hi guys. I have tried implementing PDO in my php. Basically, I have created a form, which will take a letter, and then pass it to the php file. My hope was, whatever was entered by the user, whether that was in the guise of being manually entered by them or chosen by a dropbox etc, this would then be able to be used within the LIKE comparison. When I run my file however, I get the following message: Error: SQLSTATE[HY093]: Invalid parameter number: no parameters were bound. I am a little confused by this. I have used $_POST with the HTML form element, and have specified it in the SQL syntax. Can anyone please advise me as to where I am going wrong? Quote Link to comment Share on other sites More sharing options...
benanamen Posted July 24, 2019 Share Posted July 24, 2019 This should help. Quote Link to comment Share on other sites More sharing options...
requinix Posted July 24, 2019 Share Posted July 24, 2019 In other words, if you have a problem with your code then you should probably post your code. 1 Quote Link to comment Share on other sites More sharing options...
ginerjm Posted July 24, 2019 Share Posted July 24, 2019 Show us the code for: 1 - your sql statement itself 2 - the code that 'binds' or assigns the values/vars to the parms being used in the sql statement There should be an equal number of values and parms in this code. 3 - the execute Quote Link to comment Share on other sites More sharing options...
Tokugawa Posted July 25, 2019 Author Share Posted July 25, 2019 (edited) Tired now, will post it later. Edited July 25, 2019 by Tokugawa Quote Link to comment Share on other sites More sharing options...
benanamen Posted July 25, 2019 Share Posted July 25, 2019 (edited) Your second post has absolutely nothing to do with your first post. You really should have created a new thread. A simple google search on using LIKE would have easily answered your question. I guess you didn't read the page I posted the link to. Edited July 25, 2019 by benanamen Quote Link to comment Share on other sites More sharing options...
Tokugawa Posted July 25, 2019 Author Share Posted July 25, 2019 (edited) Actually, I did. Realising it had nothing to do with my first post, I then edited it. Please don't make baseless accusations, thanks. And not only did I manage to solve my original problem myself, I was able to add additional features. Edited July 25, 2019 by Tokugawa Quote Link to comment Share on other sites More sharing options...
benanamen Posted July 25, 2019 Share Posted July 25, 2019 (edited) It wasn't "baseless" until you deleted your post after I posted, thus derailing the continuity of the thread. Great job solving the problem yourself though. 😀 Edited July 25, 2019 by benanamen Quote Link to comment Share on other sites More sharing options...
Tokugawa Posted July 25, 2019 Author Share Posted July 25, 2019 Im confused. my second post was posted 52 minutes ago. Your response was then posted 33 minutes ago, meaning that there was a 21 minute delay, rendering your claim that I deleted my post after you posted null. I asked a secondary issue, then removed it. Realising that it was not permissible to have an entirely empty post, I then posted the comment:"Tired, will post later". By post later, I meant my final, working solution with the additional content I have inserted. Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted July 25, 2019 Share Posted July 25, 2019 please post your final code. a lot of beginners end up with 'working' code, that isn't actually secure or contains a lot of unnecessary statements, variables, and php/sql syntax. Quote Link to comment Share on other sites More sharing options...
ginerjm Posted July 25, 2019 Share Posted July 25, 2019 Some of us have no f..... clue what is going on here.... The whole topic was confusing form the title on down.... Quote Link to comment Share on other sites More sharing options...
benanamen Posted July 25, 2019 Share Posted July 25, 2019 Lets just move on. Yeah, OP, I noticed something funny going on with the posts and timing of edits/deletes. It was something beyond us which made things confusing for both (all) of us. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.