SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Feel my RewiredMind KMxRetro's Avatar
    Join Date
    Jan 2001
    Location
    Exeter, Devon, UK
    Posts
    477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,
    I am currently trying to create a database content management system for my website, but have run into a problem. I have a form named edit.php which pulls data from a MySQL table so that I or someone else can edit it from wherever we are.

    Problem is that the content is quite large (in terms of words) and when I submit to a page which updates the data in the MySQL table, nothing happens. I've checked EVERYTHING. I can insert one part of the content (about 100 words) with no problem, but when I come to insert the whole article, everything seems to work, but the DB doesn't update. I've tried using the GET and POST methods on the HTML form, but to no avail.

    I have noticed that when using the GET method, the data sent through the URL is cut after a certain amount of characters.

    Is there any way around this or any way to fix it?

    Thanks,
    KMx

  2. #2
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For the GET method, the URL is cut off after 256 (or 255, not much different!) chars
    Initially I thought you could use POST, but you said you tried it...

    Does the db get update partially or nothing? You could debug this by printing out the value before putting into the DB
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  3. #3
    Feel my RewiredMind KMxRetro's Avatar
    Join Date
    Jan 2001
    Location
    Exeter, Devon, UK
    Posts
    477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Right, I debugged it (up to a point) and it seems that with the POST method, all of the data is pushing through to the dbupdate page.

    But the database still isn't updating. Is there an error in my code?

    mysql_connect($site, $username, $password);

    $query = "UPDATE reviewdata SET gamename='$gamename',territory='$territory',publisher='$publisher',introduction='$introduction',graphics='$graphics',sound='$sound',overall='$overall',graphicscore='$graphicscore',soundscore='$soundscore',gameplayscore='$gameplayscore',overallscore='$overallscore',author='$author',amazonsearch='$amazonsearch',authoremail='$authoremail',caption1='$caption1',caption2='$caption2',caption3='$caption3', WHERE gameid = '$gameid'";

    $result = mysql_db_query($dbName,$query);

    is what I have.

    Thanks,


  4. #4
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    Alkmaar, Netherlands
    Posts
    710
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did you try AddSlashes?
    Because there are special charecters which will disable your update statement. It should not be about length.

    $textfield=AddSlashes($textfield);
    "UPDATE reviewdata SET dbtextfield='$textfield',...."



  5. #5
    Feel my RewiredMind KMxRetro's Avatar
    Join Date
    Jan 2001
    Location
    Exeter, Devon, UK
    Posts
    477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't ask me how, just DON'T ask me how...

    I split the MySQL query into two parts and it's working like an absolute CHARM.

    And I only spent 10 hours on it.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •