PHP/MYSQL Insert Issue

4 replies
I have a form I'm building where I want users to submit some information via an INPUT TYPE="TEXT" box.

The db field is set to VARCHAR(16).

My problem is that only numbers seem to work. If I use letters (or any other characters) the submission does not work. I do not get any errors, but the data just doesn't appear in the database.

Example:

45 - works
try35 - does not work
try - does not work
try-45 - does not work

I've been trying to figure this out for a while now. I've changed the db field to TEXT, and to BLOB, but nothing worked.

Any suggestions?
#insert #issue #php or mysql
  • Profile picture of the author donnan
    What are your complete FIELD settings in the db for the offending field?
    {{ DiscussionBoard.errors[3200471].message }}
  • Profile picture of the author webpro4hire
    squid,

    What's the server-side code that processes the form? Perhaps the field is checked for integers?

    lets see the processing code, we'll be in a better position to help out.

    Cheers,
    WP4H
    {{ DiscussionBoard.errors[3204088].message }}
  • Profile picture of the author KirkMcD
    do you put the data within single quotes when doing the insert?
    {{ DiscussionBoard.errors[3204560].message }}
  • Profile picture of the author Big Squid
    Thanks guys. The problem was that I wasn't using single quotes when doing the INSERT.

    I appreciate your responses...
    {{ DiscussionBoard.errors[3204754].message }}

Trending Topics