Skip to content

Tag: php

How to get Doctrine to log queries in Symfony2

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 I&#82…

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 …

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 …

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…