|
|||||||
| PHP Discussion and technical support for using and deploying PHP based websites. |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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); ?> |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|