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

    Join Date
    May 2000
    Posts
    11
    Rep Power
    0
    I have created a database, and it seems to be working fine so far. However, when I try to edit my entries via a php3 file it erases all of the data I have added in the past except the first word -
    Like if the park is called 'Joshua Tree National Monument' all I get back is 'Joshua'. The database displays the data fine, but when I try to edit it erases everything after the first space....I assume I may have set up my database parameters incorrectly? Any suggestions? I am completely at a loss!

    ------------------
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    35
    Rep Power
    15
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by camparoo:
    <snip> ...when I try to edit my entries via a php3 file it erases all of the data I have added in the past except the first word...<snip>
    [/quote]

    What are you using to connect to mysql with, scripts from someone else or stuff you wrote yourself? What it sounds like is that you are not quoting you insert or update sql statements right. Try this: set var = '$var'
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    45
    Rep Power
    15
    in php , your query statment must use single quotes, as follows...

    $query = "UPDATE table SET blah='$blah' WHERE ID=$id";

    note - $id isn't in ' ' because it is an integar while $blah is because it is a string...hope it helps

Similar Threads

  1. PHP3 + MySQL returns Unknown Error on Connect
    By Projecto EINet in forum PHP Development
    Replies: 2
    Last Post: November 6th, 2003, 04:22 PM
  2. Replies: 1
    Last Post: October 2nd, 2000, 01:37 AM
  3. backup mysql database with php3
    By Jimmy in forum PHP Development
    Replies: 2
    Last Post: December 12th, 1999, 02:20 PM
  4. MySQL + PHP3 gives Unknown Error on Connect
    By Projecto EINet in forum MySQL Help
    Replies: 4
    Last Post: October 27th, 1999, 04:32 AM
  5. Replies: 1
    Last Post: August 22nd, 1999, 07:11 AM

IMN logo majestic logo threadwatch logo seochat tools logo