I’m pretty new to Symfony2, and I’m looking for a way to log SQL queries (including timings) to the same log file as the rest of my application. From what I can determine from the documentation this should all work out of the box, but after a few hours of trying I can’t figure out what IR…
Tag: php
How I can create my own pow function using PHP?
I want to create a function in which I put two values (value and its power – Example function: multiply(3, 3) result 27). I have tried so far but failed, I have searched using Google but I have been unable to find any result because I don’t know the name of this function. What I want exactly: 3,3 …
laravel 5 get current language id in controller
i’m new to laravel, and i’m wondering how to get the language_id (primary key “id” in database) by current lang_code (a column of language table). in my language model, i created a function like this …
Where do I install the Pico CMS files?
The install docs for PicoCMS say First download and extract the latest version of Pico. Upload the files to your server (via FTP or some other deployment). That’s it. Tweak the .htaccess file if required. For step 2, into which folder do I upload/copy the files? There’s several choices for us novi…
When do I have to close mysqli (Database) connection?
For now, I have one connect.php file e.g. In every other PHP file that uses MySQL queries, I use “include ‘connect.php’;” For Instance on W3Schools, they create for every query a new connection and then close it after use. See here: w3schools.com: I’m not sure if they do it just …
Looping through PHP prepared SQL statement result twice
I’m trying to loop through a SQL result in PHP twice, and I am not succeeding. I have tried to use mysqli data seek, but this does not work. Here is what I have tried so far: my-new-file.php
PHP: How can I remove from String the last word?
How can I remove, with PHP, the last word from a String? For example the string “Hi, I’m Gian Marco” would become “Hi, I’m Gian”.
PHP MVC not sending value to controller
I have been making a MVC site, I am having trouble sending the row id from my form to my controller. The code that I am using for my form gets the row ID for each db entry and assigns it to a hidden value. When the form is submitted it sends the parameters to the controller (should send $uid)
Get Instagram tagged user photos
How to get all Instagram tagged user photos? For example, I have user “user123”, and someone tagged me. How to get all images with @user123? https://api.instagram.com/v1/tags/@user123/media/recent?access_token=%%%&count=9 not working. Answer Currently there is no API to get all photos which ha…
How can I make an ad visible only to mobile users?
I want to use some mobile ads but my website has responsive design so I don’t use the m. subdomain. How can I make an ad visible only to mobile users? What about only to desktop or tablet? I’m using wordpress as a CMS. Thanks, Answer It’s quite easy using CSS3 Media Queries. In your CSS: For…