Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    2

    Unanswered: SQL using mircrosoft access

    Can some one help me on the sql of access using php.
    My database website is sing MS access database but i can't find any books or example for that. All are base on MySQL.

    Can someone help me on the INSERT, UPDATE and DELETE query?
    The SELECT query i had already figured myself.

    Table: Profiles
    ------------------
    -ID (auto munber)(PK)
    -Name (text)
    -RankID (Number)
    -Date (Date/Time) eg. 28/03/2004
    -Time (Date/Time) eg: 22:15

    Can help me see what's wrong with my code?
    When to put the (') for the VALUES.
    here are my code:

    <?php
    $Date=date('d/m/Y');
    $Time=date('H:i');
    $conn=odbc_connect("$dsn","user_id",pwsd");
    $squery_sql="INSERT INTO Profiles(ID, Name, RankID, Date, Time)
    VALUES( NULL, $Name, $RankID, $Date, $Time)";
    $results=odbc_exec($conn,$query_sql);
    ?>

  2. #2
    Join Date
    Mar 2004
    Posts
    6
    VALUES( NULL, '$Name', '$RankID', '$Date', '$Time')

    use the (') whenever you are inserting in datatypes like varchar, char, text, etc. you don't usually need it for any that deal w/ numbers

    for update:

    $my_update="UPDATE profiles SET colum_name_you_want_to_change WHERE id = 1";

    for delete:

    $my_delete="DELETE profiles WHERE id = 1"

Posting Permissions

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