Welcome Guest, Not a member yet? Register   Sign In
How to map upload.php and my table information
#1

[eluser]jaswinder_rana[/eluser]
I am using upload.php library class to upload files. it's working. Now I want to insert the data returned from upload class into a table.

Data returned is
Code:
* file_name:
    * file_type:
    * file_path:
    * full_path:
    * raw_name:
    * orig_name:
    * file_ext:
    * file_size:
    * is_image:
    * image_width:
    * image_height:
    * image_type:
    * image_size_str:

My columns do NOT have the same name as the fields returned. I can change it but I was wondering (in case) I was not able to change it then how can I pass data to my model?

- Should I create an array with same index as column names, give it values and then pass it to model

- Should I pass above data and then create new array in model?

- I can also (as mentioned) change my column names and then just pass above array and have it store the information (Assuming all sanitizing/cleaning (which I am still not sure about)) is done by db class

EDIT: If I do rename my columns then how will I manage column types (some are int and some varchar)? Do I have to make all columns varchar?



Thanks


Messages In This Thread
How to map upload.php and my table information - by El Forum - 12-17-2008, 05:24 PM
How to map upload.php and my table information - by El Forum - 12-17-2008, 06:44 PM
How to map upload.php and my table information - by El Forum - 12-17-2008, 07:08 PM
How to map upload.php and my table information - by El Forum - 12-17-2008, 07:25 PM
How to map upload.php and my table information - by El Forum - 12-17-2008, 07:30 PM
How to map upload.php and my table information - by El Forum - 12-17-2008, 07:37 PM
How to map upload.php and my table information - by El Forum - 12-17-2008, 07:44 PM
How to map upload.php and my table information - by El Forum - 12-18-2008, 07:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB