⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Uploaded file get uploaded but not saved to DB.



Awaken
  • profile picture
  • Member

Posted 23 October 2012 - 02:30 AM

Hello there, GCrud community ^.^, im pretty new to PHP development, mainly been around Java programming. Anyway, i had a developer/graphic designer code a musicstore type website, and he used codeigniter/Gcrud..

Anyways, i lost contact with him due to him no longer being able to access the internet due to personal reasons...well he used to host the site on a dedicated server, but i couldnt afford it, so i backed up all the files, and transfered them to another webhost, the problem is that everything used to work, but now im having an uploading problem.

The file gets uploaded and successfully stored, but when i click save, it doesnt write it to the database for some reason. Any idea, why this could be happening?

The database info in the codeigniter config file, is correct.(registering new users works)


Thanks for anyhelp sorry if the info isnt sufficient. :/


Have an amazing day.

Awaken
  • profile picture
  • Member

Posted 23 October 2012 - 03:08 AM

[b] PHP Version 5.2.17 [/b]

is the version my host is running, just incase its involved with anything.

Thanks have an amazing day.

noskov.biz
  • profile picture
  • Member

Posted 23 October 2012 - 07:58 AM

Hi, Awaken and welcome to the forum!
1. Please, tell me what versions of CodeIgniter and grocery CRUD are used at the project.

2. Go to the main index.php file and make sure that in the line #21 you have:

define('ENVIRONMENT', 'development');

and in the line #36 error_reporting is set to E_ALL

case 'development':
error_reporting(E_ALL);
break;


Then make sure that at the ./application/config/database.php file in the line #58 you have db_debug is set to TRUE

$db['default']['db_debug'] = TRUE;


3. Please, also tell me is there any php or js-errors in you firebug when you try to save the item?
If you will add some screenshots it would be helpfull.

Best regards!

Awaken
  • profile picture
  • Member

Posted 23 October 2012 - 17:11 PM

Not sure about the version of code igniter, but Gcrud's version is 1.2.

All those settings were already set like that.

The page doesnt throw any errors when you click save, but firebug gives me the following error.


NetworkError: 500 Internal Server Error - http://www."mywebsitenamehere".com/"directory"/index.php/music/site/music/index/insert
the information in the " " exists, just removed the actual info for personal reasons.

It also shows this under the network error.

[img]http://i45.tinypic.com/2rca2qq.png[/img]


The "...index.php/music/site/music/index/insert" directory does exist and throws this error when i tried to access it manually not sure if it only throws it if reached manually but just in case.

Fatal error: Uncaught exception 'Exception' with message 'On the state "insert" you must have post data' in /homepages/5/d386593617/htdocs/graphics/directory/application/libraries/grocery_crud.php:2464 Stack trace: #0 /homepages/5/d386593617/htdocs/graphics/directory/application/libraries/grocery_crud.php(3324): grocery_CRUD_States->getStateInfo() #1 /homepages/5/d386593617/htdocs/graphics/directory/modules/beats/controllers/site/beats.php(152): grocery_CRUD->render() #2 [internal function]: beats->index('insert') #3 /homepages/5/d386593617/htdocs/graphics/directory/system/core/CodeIgniter.php(339): call_user_func_array(Array, Array) #4 /homepages/5/d386593617/htdocs/graphics/directory/index.php(202): require_once('/homepages/5/d3...') #5 {main} thrown in /homepages/5/d386593617/htdocs/graphics/directory/application/libraries/grocery_crud.php on line 2464

Dunno why all this doesnt work, it worked before i transfered everything. I set the database info right ,the base url is right.

Thanks for all the help.

Awaken
  • profile picture
  • Member

Posted 23 October 2012 - 17:34 PM

/topic/706-add-record-does-not-work/ found this topic who had a similar event, but he fixed it, but i dont understand how he did it. maybe someone could explain.

Awaken
  • profile picture
  • Member

Posted 24 October 2012 - 16:17 PM

bump....

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 24 October 2012 - 20:22 PM

Hello [member='Awaken'] ,

Well this problem is really weird but probably there is a problem with versions. It is really weird that worked before and now don't but I can guess that some files are missing or something similar. Do those steps that I will tell you and you will probably don't have any problem. Well as you use grocery CRUD version 1.2 you are lucky that after this version we didn't have any renaming of method or something. So just follow these steps and I will explain you later why these steps are better than debugging.

1. First of all backup [b]all the files[/b] of your project in case something goes wrong to go straight back to our previous state
2. Update codeignter to the latest version (2.1.3) . Just download the latest version of Codeigntier and replace the system folder and that's it. Please remove the previous one and copy the new folder.
3. Update grocery to the latest version (1.3.2) . Just copy the assets and the application/libraries/grocery_crud.php, application/models/grocery_crud_model.php and application/config/grocery_crud.php

Check if it works for you. If yes then probably it was a bug of grocery CRUD or Codeigniter (grocery CRUD version 1.3 had lot of bug fixes and Codeigntier 2.1.3 too). If not then something is wrong with your server:
I can just guess as the problem is not specific that it could be:
a. The apache htaccess problem with the module rewrite as the index.php is still there (don't forget to change at application/config/config.php the
$config['index_page'] = 'index.php'; 

to
$config['index_page'] = 'index.php';

)

b. Problem with the php.ini and the max upload size or something similar.

Cheers
Johnny