Menu

#5 foreach error on edit row (txtsqladmin)

open
nobody
None
5
2004-06-06
2004-06-06
Anonymous
No

Warning: Invalid argument supplied for foreach()
in /var/www/htdocs/examples/txtSQLAdmin/tbl_edit.php
on line 227

recieved on clicking "edit" on row field. on screen
straight after inserting data or in browse view.

structure:
> id no limit null int x -
> name 40 unknown string - -
> mac 17 null string - -
> ipaddr 15 null string - -
> startdate 8 null string - -
> expiredate 8 null string - -
> bypass no limit null bool

data: (1 row)
edit drop 1 unknown 00:90:27:41:C2:0D
192.168.111.1 06062004 06122004 1

(btw, great work! big fan.)

Discussion

  • Nobody/Anonymous

    Logged In: NO

    oh, i tried to empty the table several times, and dropped the
    table twice and recreated. no change.

    will troubleshoot more and follow up my results in here.

     
  • Faraz Ali

    Faraz Ali - 2004-06-06

    Logged In: YES
    user_id=960003

    I Found the error, it was inside the txtSQL.class.php::_buildIf
    () function.

    It would think that '06122004' was an integer, and thus would
    reduce the number to '6122004', which in the txtSQL search,
    is not the same.

    To fix the bug, open txtSQL.class.php, go to line 1123, and
    change it from
    [code]case 2: $quotes = !is_numeric($val) ? '"' : '';[/code]
    to
    [code]case 2: $quotes = '"'[/code];

     
  • Faraz Ali

    Faraz Ali - 2004-06-06

    Logged In: YES
    user_id=960003

    better yet, open txtSQL.class.php, line 1123, and change it
    from
    [code]case 2: $quotes = !is_numeric($val) ? '"' : '';[/code]
    to
    [code]case 2: $quotes = ( !is_numeric($val) || $cols[rtrim
    ($col)]['type'] != 'int' ) ? '"' : '';[/code];

     

Log in to post a comment.