Jump to content
Tokugawa

Like comparison from form difficulty

Recommended Posts

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? 

Share this post


Link to post
Share on other sites

In other words, if you have a problem with your code then you should probably post your code.

  • Like 1

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Posted (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 by benanamen

Share this post


Link to post
Share on other sites
Posted (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 by Tokugawa

Share this post


Link to post
Share on other sites
Posted (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 by benanamen

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

Some of us have no f..... clue what is going on here....

The whole topic was confusing form the title on down....

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.