#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    26
    Rep Power
    0
    Ok, one more question... I've created a form using PHP & MySQL to allow entries to a database. My MySQL field is defined as text (which should allow for a huge amount of data to be entered). However, if I enter a lot of data into the textarea, the PHP script won't carry out the INSERT query to add the data to the database. But if I enter only a few lines of data, the entry goes in smoothly. Where am I going wrong???
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Location
    Annapolis, Maryland US
    Posts
    113
    Rep Power
    16
    Are you using the GET method or the POST method?
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    26
    Rep Power
    0
    Actually I'm not inserting any kind of method. I'm having the form send the information back to itself. Is that where the problem is?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 1999
    Location
    UK
    Posts
    50
    Rep Power
    16
    Doesn't matter that your posting the values back to itself, you still need some method of returning the values.
    Note:
    Get Method - is retrictive because it will only allow I think its up to 2000 characters.

    Ideally use the Post method.

    This might be where your problem is. Try changing the method to post. If it doesn't work then put some more information in your next message so that we can see what you are trying to do.

    Falcon
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    26
    Rep Power
    0
    Ok, I used the post method, and its still not working!!

    Here's my code:

    <html>
    <body>
    <?
    if (isset($ID) && isset ($name) && isset($majors)) {

    mysql_connect("i-20experts.com", "username", "password");

    $query = "INSERT INTO Institutions VALUES ('$ID', '$name', '$majors')";

    $result = mysql_db_query("host", $query);

    if ($result) {
    echo "<p align=center><strong>Information for $name added into database</strong></p>";
    }
    }
    ?>

    <form method="post" action="<?php echo $PHP_SELF ?>">
    <input type="Hidden" name="ID">

    Name: <input type="Text" name="name">

    Majors Offered:
    <textarea name="majors" cols="35" rows="4" wrap="VIRTUAL"></textarea>
    </form>
    </body>
    </html>

    It will accept an entry if what I enter into the "Majors Offered" field has a small amount of characters. If I enter a huge amount of data, my query won't go through.

    Please Help!!
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 1999
    Location
    Germany
    Posts
    1
    Rep Power
    0
    What datatype did you use for the last column of your table? If it's BLOB/TEXT then you can only enter 64k of text and have to change the datatype to MEDIUMBLOB/MEDIUMTEXT or larger (depending on how much you want to insert).
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    26
    Rep Power
    0
    ahhh, got it, thanksssssssss :-)

Similar Threads

  1. help with tables and wordwrapping
    By junkedBrian613 in forum PHP Development
    Replies: 2
    Last Post: February 15th, 2004, 06:42 PM
  2. how to keep table on top, not centered??
    By vinyl in forum HTML Programming
    Replies: 2
    Last Post: January 20th, 2004, 07:19 PM
  3. float question
    By yeah-yeah in forum HTML Programming
    Replies: 10
    Last Post: January 15th, 2004, 04:59 PM
  4. Javascript scrollbar - stuck on last bit
    By NayMyoSan in forum JavaScript Development
    Replies: 0
    Last Post: January 3rd, 2004, 01:05 PM
  5. Replies: 0
    Last Post: December 30th, 2003, 01:57 PM

IMN logo majestic logo threadwatch logo seochat tools logo