Posts in Category: snippets

Resize Image Without Stretching in Codeigniter

By this article “resize an image without stretching in CodeIgniter” I’m going to show you the mathematics and logic of resizing an image to a different width and height without squeezing or stretching the original image.

If the destination image contains a different aspect ratio than the source image, then the source image will

Read More

How do I test if my MySQL query was successful


or

or

also(much better)

A better solution I’ve found is to manage the difference between an ERROR and 0 affected rows. 0 affected rows is not necessarily a bad thing, but an error is something you do want to know about:

Now your function can

Read More

Query in Codeigniter

SOLUTION ONE

SOLUTION TWO

SOLUTION THREE

SOLUTION FOUR (NO ACTIVE RECORD)

you can use row() instead of result()

Accessing a single row

 

Read More

Image Snippets

 

 

Read More

CodeIgniter removing index.php from url

To remove index.php from URL using .htaccess file in CodeIgniter. htaccess is the shortened used for Hypertext Access, which is a powerful configuration file that controls the directory “.htaccess”.  CodeIgniter’s URLs are designed to be search engine friendly and to human too. and so to maintain the standards we need

Read More