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…
Tag: php
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…
submitting the form after successful paypal money transaction using php
I’ve made a form. Currently this form does the following operations: customer fills up the form (creates an order) clicks on “Submit” button all form entries are entered into a database. I’d like to change it to do the following operations: customer fills up the form in the end of the …
PHP cURL/Socket and HTTP authentication
I have a webpage with a list of HTML links for images in a protected subfolder. This folder is protected via .htaccess and HTTP authentication. Is there a way to use cURL/Socket, or something like …
How to use session_start in WordPress?
I’m creating a bilingual site and have decided to use session_start to determine the language of the page using the following: session_start(); if(!isset($_SESSION[‘language’])){ $_SESSION[‘…
Predis is giving ‘Error while reading line from server’
I am using predis, it’s subscribed to a channel and listening. It throws the following error (below) and dies after 60 secs exactly. It’s surely not my web servers error or its timeout. There is a similar issue being discussed here. Could not get much of it. I tried setting connection_timeout in p…
Resize textarea based on lines of text that comes from php/mysql variable
I dont need it to resize automatically as you type, I just need it to be the correct size when the page loads the variable is $row[‘text’]; <? echo $row['text']…
PHP MYSQL $row[$variable]
I am trying to work around with dynamic table creation and data fetching. I am trying to get the data using following code : But, I am unable to get any data back. I checked printing the query and running it in php my admin and its working as I want. But I guess variable in array might not be