Ahmediqbal.com

My Personal Weblog

Now recently I’ve coded some date/time functionality in my project..
Ohh no…! :=(
I have got one nasty error

Message: strftime() [function.strftime]: It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Karachi’ for ‘5.0/no DST’

Well well, solution was pretty simple, just be sure to add ‘php.ini’ the time zone where your server is located

  1. Search for ‘php.ini’ file in xampp/wamp etc
  2. After  opening ‘php.ini’ using ‘Ctrl+F’ search for [Date]
  3. I added the line bellow ‘date.timezone = “Asia/Karachi”’

After restarting apache the problem solved :D

Mostly PHPMyADMIn import ‘2MB‘ mysql backup file. when you are try to import large file.

ERROR: No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. See FAQ 1.16.

So how to import file???

Simply Edit Your ‘php.ini

Here is a reasonable setup:

memory_limit = 32M
post_max_size = 8M
upload_max_filesize = 7M

Don’t forget to restart apache when you’re done :D

Friends, codeigniter has already pagination library but i want to create more flexible or stylish pagnaiton with my technique. So please, follow my instruction and create one of stylish pagination for your site.

Guys, first download my pagination file >> CI_Smart_Pagination.zip

My pagination file consist on two folders.  ‘application‘ and ‘mysql

Application contain ‘config, controllers, helpers, models, views‘ folders.

let see, if you want to test my code, please create test table and import mysql/ city.sql.gz file in to your database.

What about application folder??? let see

application/autoload.php  // CI BASIC CONFIGURATION OF LIBRARIES
application/config.php
// CI BASIC CONFIGURATION
application/database.php // BASIC DATABASE CONFIGURATION

Controller:-

controllers/city.php // DEMO CONTROLLER WITH DEMO PAGINATION CODE

Note: Guys, i don’t know about your setting please configure segment with your setting.

MODEL:-

models/city_model.php // DEMO MODEL FOR GETTING CITY RECORDS FROM DATABASE

VIEWS:-

views/city_view.php // BASIC PAGINATION CSS AND REPRESENT CONTROLLER DATA

HELPERS:-

helpers/pagination_helper.php //PAGINATION HELPER

NOTE: you will check this helper logic in controllers/city.php‘ and i hope you understand how this helper work for pagination.

Guys, i’m sorry, to make more helpful documentation for this. Just try this pagination code on your system.

not big deal you will easily understand this pagination.

Pagination Screenshots:-