UPDATES VIA   RSS  |  Email Get updates via feedburner Get updates via twitter
Home

Posts tagged with PHP

SQLite, MySQL, PHP: Ternary operator (IF() statement) in MySQL and SQLite

Posted on 03. Feb, 2010 by .

4

While working on a proxy checker tool for one of my projects, I was struggling on how to execute a conditional query on my SQLite database to update a column only if its value is greater than 0 (it would be pointless in my case to let the script update the column with negative values). [...]

Continue Reading

WordPress 2.8.4: Not ready to be installed with PHP 5.3 ?

Posted on 01. Sep, 2009 by .

2

I’ve just tried to install WordPress 2.8.4 on my testing machine (PHP 5.3). Right on the installation page a dozen of errors filled my screen, something like: Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with that of Walker::start_lvl() in /opt/lampp/htdocs/wordpress/wp-includes/classes.php on line 1214 This is not a big issue and it doesn’t interrupt the [...]

Continue Reading

PHP: How to get creation time of file with PHP on Linux machines

Posted on 01. Sep, 2009 by .

1

Unfortunately it is not possible to get the creation time of a file on Linux machines. None of the functions fileatime,filemtime or filctime will return the file creation time. Note: Note also that in some Unix texts the ctime of a file is referred to as being the creation time of the file. This is [...]

Continue Reading

PHP: Script to extract one’s contacts from email (Gmail, Yahoo,Hotmail,AOL…) and send invites – OpenInviter to go!

Posted on 18. Aug, 2009 by .

4

You’ll find many scripts to extract email contacts, but many of these are either commercial or just given as apis. For the last case, it’s good to extract contacts from an email using an external server, because that’ll help reduce the server load, but what if the website providing that service goes down? Not good. [...]

Continue Reading

PHP Error: Call to a member function fetch_assoc() on a non-object in

Posted on 23. Jun, 2009 by .

4

If you get this error: Call to a member function fetch_assoc() on a non-object in … , it means that you have an error in your mysql syntax. Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you’re getting the error on. $mysqli=new mysqli(HOST,USER,PASS,DB); $mQuery=$mysqli->query(‘select `data` from `this_table` where [...]

Continue Reading

PHP: Get all files and folders from a directory (folder)

Posted on 16. Jun, 2009 by .

2

To get all files and folders from a directory (folder) I found scandir to be the perfect solution. scandir scans a directory and returns an array containing all files and directories under the parent directory we’re looking in. The code below will try to remove a directory, if the element is a directory or delete [...]

Continue Reading

WordPress: Easily Reset Your Account Password Using MySQL and PHP

Posted on 08. Jun, 2009 by .

4

I’ve just forgot my admin password on my local testing blog, and what is worse – my local machine is not configured to send external email. Oh yeah, got to reinstall wordpress again, what a pity. No way! There are two ways of resetting your password using two easy methods. You’ll need basic knowledge of [...]

Continue Reading