Jump to content

Like comparison from form difficulty


Tokugawa

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? 

Link to comment
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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
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. 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.