www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Server-Side Development > PHP

    PHP Discussion and technical support for using and deploying PHP based websites.

     
     
    Thread Tools Search this Thread Rate Thread Display Modes
    Prev Previous Post   Next Post Next
      #1  
    Old 10-31-2003, 10:53 AM
    notsobright notsobright is offline
    Registered User
     
    Join Date: Oct 2003
    Posts: 3
    Question Insert using ODBC connection to access

    I am trying to insert data into a database but keep getting the error must be an updateable query, my database is not write protected and is in my inetpub directory not the root whether I use execute, exec, do or prepare I get the same problem is it my code or am I doing something wrong with my database here is my code:

    <?php
    // connect to ODBC
    if ( !( $database = odbc_connect( "nicdb3", "","")))
    die( "Could not connect to database" );
    $from = 'steve';
    $to = 'bright';
    $query = "INSERT INTO mytable (jor_from, jor_to) VALUES($from, $to)";

    /* check for errors */
    if (!odbc_exec($database, $query))
    {
    /* error */
    echo "Whoops";
    }
    ?>
    <?php
    odbc_close( $database);
    ?>
    Reply With Quote
     

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 02:44 AM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.