Skip to content

Tag: php

PHP MySQL Insert Ignore Inserting Too Much Data

I have a traffic exchange and every time a site is viewed I want it to insert in to a table which looks like: -user -site The user is default of 1 and I don’t insert in to it because I thought for an INSERT IGNORE you need a column that stays in the same. My current query: I have

Calculate the number of months between two dates in PHP?

Without using PHP 5.3’s date_diff function (I’m using PHP 5.2.17), is there a simple and accurate way to do this? I am thinking of something like the code below, but I don’t know how to account for leap years: I’m trying to work out the number of months old a person is. Answer You may …

s3 direct upload restricting file size and type

A newbie question but I have googled abit and can’t seem to find any solution. I want to allow users to directly upload files to S3, not via my server first. By doing so, is there any way the files can be checked for size limit and permitted types before actually uploading to S3? Preferably not to use f…

PHP code for moving the cursor using the twitter API

So I already have a script that collects the first 4999 followers ids of a twitter user using the API in xml format. I semi understand how the cursor process works but I am confused how to implement it to loop until it gathers all the followers. The user I am attempting to gather will take about 8 calls. Any