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

    Join Date
    Jun 2000
    Posts
    2
    Rep Power
    0
    Hi,

    I'm having a real problem. I've written some scripts to display information from a PostGreSQL database in a table format, and everything is fine.

    I've been adding data manually up until now. So, I've written a page where users input their information and this gets inserted into the relevant table. However, this isn't working.
    I have been chopping code out to the bare minimum just to get something working, but even the simplest thing doesn't work.

    Here's what I've got at the moment :
    $resultSet = pg_exec($conn, "INSERT INTO ntable (make, model) VALUES ('Suzuki', 'Bandit'))";

    I have connected ok, so there's no problem there, but the above line produces :
    Parse error: parse error in /web/sites/042/grendel/www.grendel.f2s.com/addins.php3 on line 39

    Please help me someone. I have many different things, but nothing seems to work. The field names are fine, and the data types are both varchar.

    Thanks in advance,

    Gareth.
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15
    $resultSet = pg_exec($conn, "INSERT INTO ntable (make, model) VALUES ('Suzuki', 'Bandit')");<-- you had ' ))";'

    Another thing to check is do you have an index on at least one of the fields in ntable? - the f2s postgresSQL database is v fussy.

    regards,
    Simon.

    ------------------
    Simon Wheeler
    FirePages -DHTML/PHP/MySQL
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    2
    Rep Power
    0
    D'Oh, what an idiot I am. I think it was too many late nights and a case of not seeing the wood for the trees!

    Thanks a lot Simon.

    Cheers,

    Gareth.

Similar Threads

  1. Zip code validation
    By krwyth in forum MySQL Help
    Replies: 2
    Last Post: January 5th, 2004, 01:29 PM
  2. error - parent key
    By mbonfyre in forum Oracle Development
    Replies: 1
    Last Post: November 29th, 2003, 12:44 PM
  3. Temporary table Questions
    By dimitrisk in forum MySQL Help
    Replies: 11
    Last Post: October 6th, 2003, 01:07 PM
  4. Using Array to insert data
    By traffic_jammer in forum PHP Development
    Replies: 1
    Last Post: September 19th, 2003, 02:50 PM
  5. Huge MySQL -> PostgreSQL w/ data Conversion
    By Bytter in forum PostgreSQL Help
    Replies: 3
    Last Post: August 18th, 2003, 11:35 AM

IMN logo majestic logo threadwatch logo seochat tools logo