insert mysql query into a history table... ?

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default insert mysql query into a history table... ?

    hi guys,

    i have created a 'history' table and would like to insert the 'bare' sql
    query into that table just to check who did what on the database...

    now, i have this :-

    $CustUpdate = "INSERT INTO record SET
    recid = '',
    customer_code = '$varCustomerCode',
    id_reg = '$varId_Reg',
    date_added = '$getCurrentDate',
    date_modified = '0000-00-00 00:00:00',
    date_closed = '0000-00-00 00:00:00',
    technician = '$varConsultant',
    flag = '$flag',
    contact_person = '$varContactPerson',
    contact_number = '$varContactNumber',
    contact_email = '$varContactEmail',
    problem_type = '$varProblemType',
    problem_description = '$varProblemDescription',
    priority = '$varPriority',
    technical_feedback = '',
    customer_name = '$varCustomerName'
    ";

    i would like to add the whole query into a text field in the 'history'
    table, but i get errors when i try to add it... can anyone help ?

    this is the error :-

    Invalid query: You have an error in your SQL syntax near '2004-06-23
    11:09:57', date_modified = '0000-00-00 00:00:00', date_closed =' at line 6


    Gawie Marais Guest

  2. Similar Questions and Discussions

    1. Deletion based on the result of a 3 table right joins select query (MySQL 3.23)
      I am using MySQL 3.23 I have a relatively complex database with a number of Many to Many relationships (using link tables). I want to delete...
    2. php/mysql query insert values into enters the records in reverse order
      I'm loading tab delimited lines from a txt file using php and running a query for each line to enter the data into a mysql database. However the...
    3. Login - multi table insert for registrant; subsquent login insert page requests into joined 'Selection' Table
      Question regards insert and updates in sql server for a simple login script that requires registration the first time and only "email address" upon...
    4. I can't insert into mySQL db table - HELP!
      I have to get this done by tonight! I have a .CSV file and a PHP file where I am inserting the values of the CSV file into the db table. See the...
    5. Result of Mysql Query in a PHP table
      Hi, I've a problem: I want to have the result of my Mysql Query in a Table in my php file. Now I've this: <?
  3. #2

    Default Re: insert mysql query into a history table... ?

    Gawie Marais wrote:
    > i would like to add the whole query into a text field in the 'history'
    > table, but i get errors when i try to add it... can anyone help ?
    [url]http://uk2.php.net/manual/en/function.addslashes.php[/url]



    Andy Barfield Guest

  4. #3

    Default Re: insert mysql query into a history table... ?

    thanx guys.



    "Gawie Marais" <gmlists@gam.co.za> wrote in message
    news:cbbhk8$748$1@ctb-nnrp2.saix.net...
    > hi guys,
    >
    > i have created a 'history' table and would like to insert the 'bare' sql
    > query into that table just to check who did what on the database...
    >
    > now, i have this :-
    >
    > $CustUpdate = "INSERT INTO record SET
    > recid = '',
    > customer_code = '$varCustomerCode',
    > id_reg = '$varId_Reg',
    > date_added = '$getCurrentDate',
    > date_modified = '0000-00-00 00:00:00',
    > date_closed = '0000-00-00 00:00:00',
    > technician = '$varConsultant',
    > flag = '$flag',
    > contact_person = '$varContactPerson',
    > contact_number = '$varContactNumber',
    > contact_email = '$varContactEmail',
    > problem_type = '$varProblemType',
    > problem_description = '$varProblemDescription',
    > priority = '$varPriority',
    > technical_feedback = '',
    > customer_name = '$varCustomerName'
    > ";
    >
    > i would like to add the whole query into a text field in the 'history'
    > table, but i get errors when i try to add it... can anyone help ?
    >
    > this is the error :-
    >
    > Invalid query: You have an error in your SQL syntax near '2004-06-23
    > 11:09:57', date_modified = '0000-00-00 00:00:00', date_closed =' at line 6
    >
    >

    Gawie Marais Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139