• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mysql Database issues

[eluser]Derek Allard[/eluser]
OK, I want to get this fixed up for you guys, could you please provide the code you're using?

Derek, thanks for your concern. I have to admit thats what I love about this community.

I will trouble shoot and test things as soon as possible and get back to you.

[eluser]James Pax[/eluser]
yay! Thank you Derek Allard!

my code is attached to this post, I tried to get it on here as quickly as possible... I hope it's commented enough

the file is zip I just changed the ".zip" to ".jpg"

edit: ops I don't see any way to grab the .jpg from the post... hopefully your admin privileges can grant you access to it? :long:

[eluser]Derek Allard[/eluser]
I'm sorry, I can't recover that. I'm happy to help though. Could you just cut and paste the most basic, simple example that you can that shows this behaviour? I don't need to see any login code, or anything like that, just the few lines that you are using to create the fields. I'm trying to rule out if this is a dbforge thing, or something else.

Derek, with this code


I'm getting
Quote:ALTER TABLE `table_name` ADD Array NOT NULL

using MySQLi and
Quote:ALTER TABLE `table_name` ADD `last_name` varchar(50) NOT NULL
using MySQL driver

[eluser]James Pax[/eluser]
thank you seppo... my internet got cut off last night (ugly provider lol) and had problems sending in my code!


I'm getting this:

//get the list of tables
       $tables = $this->db->list_tables();

        //parse the tables
        foreach ($tables as $table)
            //get table field metadata
               $fields = $this->db->field_data($table);
            //parse fields one by one
            foreach ($fields as $field)
                   //array fields check

gives me no "type" and probably wrong "max_length" in 'mysqli'
(edit: I don't know about the primary_key it might return the length of the int,the result doesn't change I guess length of FALSE=0 length of TRUE=1 ?? )
array(1) { ["id"]=>  array(3) { ["type"]=>  string(6) ["max_length"]=>  int(1) ["primary_key"]=>  int(1) } }
(edit: with 'mysql' driver I get the type in the var_dump)

then I get just like seppo:

even for modify_column
(edit: by passing an array like the one above)
I'm so happy Derek Allard is going to give a look into it Big Grin

ps: damn had to wait another 5 hours to post this...

[eluser]James Pax[/eluser]
I've got my fingers crossed Smile any news?

[eluser]Derek Allard[/eluser]
I think you're waiting for me? No, I'm sorry, I haven't even read the forums in 3 days unless I got an email notification. I'm just buried. Your issue is on my "to-do", and the debugging by you and Seppo is very helpful, but I probably won't get to turn my attention to CI for another week or two. Apologies, I didn't mean to have you think it'd be an instant fix Wink

Derek, if I may... Why is the mysqli forge class so different to the mysql? I mean... they both should produce the same SQLs...
In MySQL forge you have a method _process_fields that's used twice, while in mysqli you have a similar code in _create_table and some bug code in _alter_table...
Could you just look at it for a sec trying to copy+paste the mysql forge to mysqli?

Doing that, and replacing the two times MySQL appear seems to fix this issue =)

[eluser]Derek Allard[/eluser]
what the!?!?

That is SUPPOSED to be what the files look like. Ugh. I've made the change, can you grab a new svn and retest.

I need more coffee...


... and beer.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.