Cannot delete a column

Issue #159 duplicate
Former user created an issue

Originally reported on Google Code with ID 159

What steps will reproduce the problem?
1. table structure viewed
2. select red "delete" next to column
3. click Confirm

What is the expected output? Success & Confirmation
What do you see instead?
"Error: .
This may be a bug that needs to be reported at code.google.com/p/phpliteadmin/issues/list"


What version of the product are you using? 1.9.3
On what operating system? Windows 7
Which Database Extension (PDO/SQLiteDatabase/SQLiteDatabase3 - see Database

Path to database: C:/xampp/htdocs/dclapp/db/dcl.db
Size of database: 1107322 KB
Database last modified: 2:20am on November 25, 2012
SQLite version: 3.7.3
SQLite extension [?]: PDO
PHP version: 5.3.5


Please provide any additional information below.

Reported by lewznmymind on 2012-11-25 01:33:24

Comments (11)

  1. Christopher Kramer
    Thanks for reporting this issue.
    Could you please provide me with debug output? To do so, open phpliteadmin.php in a
    texteditor, search for $debug = false; and set it to $debug = true;
    Then try to delete the column again. A lot of output will appear at the top of the
    page. Please post this here so I can figure out what the problem is.
    
    Another problem (see issue #143) that might be the same as yours has already been fixed
    in the development version. You might try the current development version to see whether
    the problem is already fixed in there. You can get it here:
    
    http://phpliteadmin.googlecode.com/svn/source/1.9.4/phpliteadmin.php
    

    Reported by crazy4chrissi on 2012-11-25 10:14:33

  2. Former user Account Deleted
    Hi, sure, glad to help.
    
    Are you sure you want to delete column(s) delete_flag from table 'projects'?
    
     Cancel
    Powered by phpLiteAdmin | Page generated in 0.0279 seconds.Warning: Unknown: open(/var/php_sessions/sess_25176fa542ee8b21e9802caad1fb009d,
    O_RDWR) failed: No such file or directory (2) in Unknown on line 0 Warning: Unknown:
    Failed to write session data (files). Please verify that the current setting of session.save_path
    is correct (/var/php_sessions) in Unknown on line 0
    
     
    
    ------------------------------------
    
    ALTER TABLE QUERY=(ALTER TABLE "projects" DROP "delete_flag"), tablename=(projects),
    alterdefs=(DROP "delete_flag")
    ________________________________
    ALTER TABLE: table=(projects), alterdefs=(DROP "delete_flag")
    ________________________________
    SQL?
    SQL?
    createtemptableSQL=(CREATE TEMPORARY TABLE 't1353890610' CREATE TABLE "projects" (
    `projectid` varchar(50) NOT NULL default '{00000000-0000-0000-0000-000000000000}',
    `catid` varchar(50) NOT NULL default '{00000000-0000-0000-0000-000000000000}', `name`
    varchar(80) NOT NULL, `date` unsigned int(11) NOT NULL, `size` unsigned int(11) NOT
    NULL, `notes` text, `spinetext` varchar(80) default NULL, `othertext` varchar(25) default
    NULL, `rating` UNSIGNED tinyint(3) NOT NULL default '3', `specid` varchar(50) NOT NULL
    default '{00000000-0000-0000-0000-000000000000}', `thumbid` varchar(50) NOT NULL default
    '{00000000-0000-0000-0000-000000000000}', `accountid` varchar(50) NOT NULL default
    '{00000000-0000-0000-0000-000000000000}', `last_edit_accountid` varchar(50) default
    NULL, `subjectid` varchar(50) NOT NULL, `colorid` varchar(50) NOT NULL, `programid`
    varchar(50) NOT NULL default '{00000000-0000-0000-0000-000000000000}', `templateid`
    varchar(50) NOT NULL default
     '{00000000-0000-0000-0000-000000000000}', `approved` tinyint(1) NOT NULL default '0'
    , `locked` tinyint(1) NOT NULL default '0' , `downloadcnt` int(10) NOT NULL default
    '0' , `delete_flag` smallint(6) NOT NULL default '0', `adult_flag` tinyint(1) NOT NULL
    default '0', PRIMARY KEY (`projectid`,`catid`) ))
    ________________________________
    SQL?
    def=DROP "delete_flag"
    ________________________________
    action=(drop), column=(delete_flag), column_escaped=(delete_flag)
    ________________________________
    preg_column_definition=(\s*(?:'(?:[^']|'')+'|[^ '"\[`]+|"(?:[^"]|"")+"|`(?:[^`]|``)+`|\[(?:[^\]]|\]\])+\])(?:\s+(?:'(?:[^']|'')*'|[^'",`\[)
    ]*|"(?:[^"]|"")*"|`(?:[^`]|``)*`|\[(?:[^\]]|\]\])*\]))+)
    ________________________________
    preg_columns_before=((?:((?:\s*(?:'(?:[^']|'')+'|[^ '"\[`]+|"(?:[^"]|"")+"|`(?:[^`]|``)+`|\[(?:[^\]]|\]\])+\])(?:\s+(?:'(?:[^']|'')*'|[^'",`\[)
    ]*|"(?:[^"]|"")*"|`(?:[^`]|``)*`|\[(?:[^\]]|\]\])*\]))+,\s*)*\s*(?:'(?:[^']|'')+'|[^
    '"\[`]+|"(?:[^"]|"")+"|`(?:[^`]|``)+`|\[(?:[^\]]|\]\])+\])(?:\s+(?:'(?:[^']|'')*'|[^'",`\[)
    ]*|"(?:[^"]|"")*"|`(?:[^`]|``)*`|\[(?:[^\]]|\]\])*\]))+),\s*)?)
    ________________________________
    CREATE TEMPORARY TABLE 't1353890610' CREATE TABLE "projects" ( `projectid` varchar(50)
    NOT NULL default '{00000000-0000-0000-0000-000000000000}', `catid` varchar(50) NOT
    NULL default '{00000000-0000-0000-0000-000000000000}', `name` varchar(80) NOT NULL,
    `date` unsigned int(11) NOT NULL, `size` unsigned int(11) NOT NULL, `notes` text, `spinetext`
    varchar(80) default NULL, `othertext` varchar(25) default NULL, `rating` UNSIGNED tinyint(3)
    NOT NULL default '3', `specid` varchar(50) NOT NULL default '{00000000-0000-0000-0000-000000000000}',
    `thumbid` varchar(50) NOT NULL default '{00000000-0000-0000-0000-000000000000}', `accountid`
    varchar(50) NOT NULL default '{00000000-0000-0000-0000-000000000000}', `last_edit_accountid`
    varchar(50) default NULL, `subjectid` varchar(50) NOT NULL, `colorid` varchar(50) NOT
    NULL, `programid` varchar(50) NOT NULL default '{00000000-0000-0000-0000-000000000000}',
    `templateid` varchar(50) NOT NULL default
     '{00000000-0000-0000-0000-000000000000}', `approved` tinyint(1) NOT NULL default '0'
    , `locked` tinyint(1) NOT NULL default '0' , `downloadcnt` int(10) NOT NULL default
    '0' , `delete_flag` smallint(6) NOT NULL default '0', `adult_flag` tinyint(1) NOT NULL
    default '0', PRIMARY KEY (`projectid`,`catid`) )
    ________________________________
    CREATE TEMPORARY TABLE 't1353890610' CREATE TABLE "projects" ( `projectid` varchar(50)
    NOT NULL default '{00000000-0000-0000-0000-000000000000}', `catid` varchar(50) NOT
    NULL default '{00000000-0000-0000-0000-000000000000}', `name` varchar(80) NOT NULL,
    `date` unsigned int(11) NOT NULL, `size` unsigned int(11) NOT NULL, `notes` text, `spinetext`
    varchar(80) default NULL, `othertext` varchar(25) default NULL, `rating` UNSIGNED tinyint(3)
    NOT NULL default '3', `specid` varchar(50) NOT NULL default '{00000000-0000-0000-0000-000000000000}',
    `thumbid` varchar(50) NOT NULL default '{00000000-0000-0000-0000-000000000000}', `accountid`
    varchar(50) NOT NULL default '{00000000-0000-0000-0000-000000000000}', `last_edit_accountid`
    varchar(50) default NULL, `subjectid` varchar(50) NOT NULL, `colorid` varchar(50) NOT
    NULL, `programid` varchar(50) NOT NULL default '{00000000-0000-0000-0000-000000000000}',
    `templateid` varchar(50) NOT NULL default
     '{00000000-0000-0000-0000-000000000000}', `approved` tinyint(1) NOT NULL default '0'
    , `locked` tinyint(1) NOT NULL default '0' , `downloadcnt` int(10) NOT NULL default
    '0' , `delete_flag` smallint(6) NOT NULL default '0', `adult_flag` tinyint(1) NOT NULL
    default '0', PRIMARY KEY (`projectid`,`catid`) )
    ________________________________
    /^\s*(CREATE\s+TEMPORARY\s+TABLE\s+'?t1353890610'?\s*\()(?:((?:\s*(?:'(?:[^']|'')+'|[^
    '"\[`]+|"(?:[^"]|"")+"|`(?:[^`]|``)+`|\[(?:[^\]]|\]\])+\])(?:\s+(?:'(?:[^']|'')*'|[^'",`\[)
    ]*|"(?:[^"]|"")*"|`(?:[^`]|``)*`|\[(?:[^\]]|\]\])*\]))+,\s*)*\s*(?:'(?:[^']|'')+'|[^
    '"\[`]+|"(?:[^"]|"")+"|`(?:[^`]|``)+`|\[(?:[^\]]|\]\])+\])(?:\s+(?:'(?:[^']|'')*'|[^'",`\[)
    ]*|"(?:[^"]|"")*"|`(?:[^`]|``)*`|\[(?:[^\]]|\]\])*\]))+),\s*)?\s*(?:'delete_flag'|delete_flag|"delete_flag"|`delete_flag`|\[delete_flag\])\s+(?:(?:'(?:[^']|'')*'|[^,')"\[`]*|"(?:[^"]|"")*"|`(?:[^`]|``)*`|\[(?:[^\]]|\]\])*\]))+(,\s*([^)]+))?\s*\)\s*$/
    ________________________________
    
    phpLiteAdmin v1.9.3
    Documentation | License | Project Site
    Change Database[rw] dcl.db
    [rw] dclcommunity.db
    dcl.dbSQL?
    [table] project_cats
    [table] project_specs
    [table] project_thumbs
    [table] projects
    
    Create New Database [?]
     
    dcl.db → projects
    
    
    Error: .
    This may be a bug that needs to be reported at code.google.com/p/phpliteadmin/issues/list
    
    Return
    Powered by phpLiteAdmin | Page generated in 0.0904 seconds.Warning: Unknown: open(/var/php_sessions/sess_25176fa542ee8b21e9802caad1fb009d,
    O_RDWR) failed: No such file or directory (2) in Unknown on line 0 Warning: Unknown:
    Failed to write session data (files). Please verify that the current setting of session.save_path
    is correct (/var/php_sessions) in Unknown on line 0
    
    
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    "Rudeness is the weak man's imitation of strength." - Eric Hoffer
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    

    Reported by lewznmymind on 2012-11-26 00:44:46

  3. Former user Account Deleted
    I couldn't get 1.9.4 beta to work at all. Every time I select anything it takes me back
    to the login screen.�
    
    dave
    
    
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    "Rudeness is the weak man's imitation of strength." - Eric Hoffer
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    

    Reported by lewznmymind on 2012-11-26 01:04:48

  4. Christopher Kramer
    Thanks.
    
    First of all, your php setup seems to be configured badly. You say you are running
    Win 7, but the path to your session data looks like a unix path: /var/php_sessions
    This will not work on a windows machine of course.
    This also causes the problem with 1.9.4. and will cause problems with about any php
    script ;-)
    To correctly configure php, open php.ini (usually under c:\Windows\php.ini or, as you
    seem to use xampp, under C:\xampp\php\php.ini), search for "session.save_path". Create
    a folder somewhere for session-data like C:\temp\php_sessions and then set this option
    to this folder:
    session.save_path = "C:\temp\php_sessions"
    
    Or on xampp, the default is this:
    session.save_path = "C:\xampp\tmp"
    (make sure the folder exists)
    
    Nevertheless I suspect there is a bug in the alter table function that causes problems
    for you, so I'll also have a look at the rest of the debug output in the meantime.
    

    Reported by crazy4chrissi on 2012-11-26 09:21:08

  5. Christopher Kramer
    Okay, I had a look at your alterTable debug output. I think this problem should be fixed
    in 1.9.4.
    Please try to setup php correctly and the have a try with 1.9.4.
    
    By the way: After you change php.ini, you need to restart Apache (or Windows completely).
    Using xampp, the easiest way is to use the XAMPP control panel, which you can find
    by clicking the windows-icon and then typing "xampp".
    If the window does not show up, rightclick the orange X-icon on the lower right next
    to the windows-clock and click "Show/Hide". Then click the "Stop" icon next to "Apache",
    wait until "Apache" is not shown green anymore and then click "Start".
    Wait some seconds. If "Apache" does not show up green, you might need to click "Start"
    a few times.
    
    Alternatively, just restart windows ;-)
    

    Reported by crazy4chrissi on 2012-11-26 09:32:50

  6. Former user Account Deleted
    Thanks, I'll check that out...
    
    
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    "Rudeness is the weak man's imitation of strength." - Eric Hoffer
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    

    Reported by lewznmymind on 2012-11-28 07:36:16

  7. Christopher Kramer
    Does 1.9.4 work after configuring php correctly?
    

    Reported by crazy4chrissi on 2013-01-20 22:52:30 - Status changed: Started

  8. Former user Account Deleted
    I am using localhost under xampp...
    
    I am using phpLiteAdmin v1.9.3.3...
    
    My php.ini has: 
    session.save_path = "C:\xampp\tmp"
    
    When I try to delete a column from a table I get:
    
    Error: .
    This may be a bug that needs to be reported at
    code.google.com/p/phpliteadmin/issues/list
    
    Dave
    

    Reported by lewznmymind on 2013-01-21 03:28:04

  9. Christopher Kramer
    Hey Dave.
    Thanks. Yeah, in 1.9.3.3, only security issues have been fixed, there are known problems
    of alter table in there.
    Could you please have a try with 1.9.4?
    
    http://phpliteadmin.googlecode.com/svn/source/1.9.4/phpliteadmin.php
    

    Reported by crazy4chrissi on 2013-01-21 09:02:40

  10. Log in to comment