When I run phpsize,get the following error: I have installed xcode 4.3.2 Answer You need autoconf utility to complete the installation. You can install Homebrew and then do brew install autoconf in Terminal. After that repeat XCache installation. I prefer Homebrew because it’s easy to use and it puts al…
PHP $_SESSION for multiple users at once
I’m wondering about how the $_SESSION array works. If I have a lot of users using my site do I need to set a subarray for each user? For instance right now I have $_SESSION[‘userid’] = $userid; $…
How should I got about setting up a local LAMP stack with switchable PHP and MySQL on OS X?
I’m moving house in a few weeks and am taking the opportunity to update my tech setup, switching from a MacBook Pro and a MacBook Air to a MacBook Air (which will be my day-to-day computer) and a Mac Mini Server (which will be a media hub and be used for heavy lifting). As part of this process, I’…
Javascript getTime to php date
I have javascript that turns dates in my view to a time string using getTime(). That then is stored as a value for an option in my select form. Once it is passed to php, how do I turn that into a php date? I have done: Answer You use PHP’s date() function: Updated, thanks Yoshi.
Using PHP/MYSQL book but get no output from PHP when trying to access the database
I’m currently working my way through “PHP and MySQL Web Development.” I’ve successfully created databases and been able to make tables and use the database. I’ve also successfully completed all the …
How to output (to a log) a multi-level array in a format that is human-readable?
I’m working on a drupal site and when debugging, I am always having to read through long, nested arrays. As a result, a large portion of my life is spent using the arrow, return, and tab keys, to split up 1000+ character strings into a nested, readable format. For drupal devs, I can’t use devel…
Using time zones in a PHP web application
I’ve been looking around for a few hours now about what’s the best way to use timezones in a PHP/MySQL web application, finding a definitive answer is hard. From what I’ve learnt so far it is best to store everyones stuff in the database in UTC (correct me if I am wrong). When a user registe…
Opencart – How I can execute a custom code on product page? Without mods on controller product
I’m working on a Custom Mod for OpenCart. I want to populate the Product page when the customer opens it via a link. I don’t want to touch the MVC controller etc – can I just make an Ajax Call or do PHP inside the View? Answer Yes you can do this without touching the MVC pattern; although it…
PHP, convert UTF-8 to ASCII 8-bit
I’m trying to convert a string from UTF-8 to ASCII 8-bit by using the iconv function. The string is meant to be imported into an accounting software (some basic instructions parsed accordingly to SIE standards). What I’m running now: This works for accounting software #1, but software #2 complains…
Using pdo in php with stored procedure
I have a simple stored procedure in MySQL database: When calling this procedure in mysql-workbench it returns the data I put in: Now when I call it from PHP using pdo I get an error: Here is my php code: Answer You need to use bindValue instead of bindParam. When you use bindParam, it binds the variable provi…