Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts

Sunday, June 10, 2012

Format mysql datetime with php


I have a datetime column in mysql which I need to convert to mm/dd/yy H:M (AM/PM) using PHP.

Monday, June 4, 2012

Best practices for withstanding launch day traffic burst


We are working on a website for a client that (for once) is expected to get a fair amount of traffic on day one. There are press releases, people are blogging about it, etc. I am a little concerned that we're going to fall flat on our face on day one. What are the main things you would look at to ensure (in advance without real traffic data) that you can stay standing after a big launch.

Friday, June 1, 2012

user manual (seo + auto generate)


i have a website that allows people to get the manual online. i have a new version of the manual where everything is generated dynamically using php and mysql. so no more html generated.

Wednesday, May 30, 2012

What is the best collation to use for MySQL (with PHP)


I'm wondering if there is a "best" choice for collation in MySQL for a general website where you aren't 100% of what will be entered? I understand that all the encodings should be the same, such as MySQL, Apache, the HTML and anything inside PHP.

Tuesday, May 29, 2012

separate different version of a website


I want to make sure I want to optimize and make my site very easy to maintain for different version of my site.

XAMPP and WAMP in the LAMP, whats the best?


We have got loads of options for php + MySQL + Apache combo... Which is the best pack among these ?

Sunday, May 27, 2012

rewrite urls for product name


i want to rewrite a rule for my products.



i want to use the id and name in the url separated by a dash like this:

Friday, May 25, 2012

mysqli or PDO - what are the pros and cons?


In our place we're split between using mysqli and PDO for stuff like prepared statements and transaction support. Some projects use one, some the other. There is little realistic likelihood of us ever moving to another RDBMS.

Thursday, May 24, 2012

UTF-8 all the way through


I'm setting up a new server, and want to support UTF-8 fully in my web application. I have tried in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.

How does Facebook achieve good performance?


Almost everyone has a Facebook account, even people who are not familiar with the Internet. With millions people actively using Facebook, updating their status, replying to messages, uploading photos and so on, how is Facebook's page still loading very fast?

datetime vs timestamp?


What would you recommend using between a datetime and a timestamp field, and why? (using mysql). I'm working with php on the server side.

How should I ethically approach user password storage for later plaintext retrieval?


As I continue to build more and more websites and web applications I am often asked to store user's passwords in a way that they can be retrieved if/when the user has an issue (either to email a forgotten password link, walk them through over the phone, etc.) When I can I fight bitterly against this practice and I do a lot of ‘extra’ programming to make password resets and administrative assistance possible without storing their actual password.

Best way to stop SQL Injection in PHP


So specifically in a mysql database, I understand that this is vulnerable to SQL injection . Take the following code and tell me what to do.

Wednesday, May 23, 2012

Database Structure Advice Needed


Im currently working on a site which will contain a products catalog. I am a little new to database design so I'm looking for advice on how best to do this. I am familiar with relational database design so I understand "many to many" or "one to many" etc (took a good db class in college). Here is an example of what an item might be categorized as:

MySQL datetime fields and daylight savings time — how do I reference the "extra' hour?


I'm using the America/New York timezone. In the Fall we "fall back" an hour -- effectively "gaining" one hour at 2am. At the transition point the following happens:

Achievements / Badges system


I have been browsing this site for the answer but I'm still a little unsure how to plan a similar system in its database structure and implementation.

Sunday, May 20, 2012

Convert MySql DateTime stamp into JavaScript"s Date format


Does anyone know how I can take a mysql datetime stamp, such as YYYY-MM-DD HH:MM:SS and either parse it or convert it to work in JavaScript's Date() function, such as.. Date('YYYY, MM, DD, HH, MM, SS);

Can something "bad' happen via img src?


I know, I know, title is quite bad, but I'll try to explain what I mean here. So, I ask my members to show their photos. They upload it somewhere, then paste their photos' URL into input and I save it to my database (MYSQL). Then, the photo is being seen on their profiles. I get the URL from database and do something like that: <img src="<?=$photo;?>" height="123px" width="123px">"> where $photo is URL taken from MYSQL. Is it totally safe? Can somebody upload for example .php file and harm my website? Do I need to check if URL's ending is .gif, .png, .jpg?

"How the sausage is made' tour of apache/php/mysql interaction


I am having trouble understanding how apache/php/mysql stack works on a low level (including interaction with the browser). Is there a good description somewhere (a book, a website, etc) that will walk me through the whole path and explaining how starting with a browser reqesting a url, http requests is being sent, how apache talks to php, how php talks to mysql (persistant and non-persistant connections), etc, etc. I want to understand what waits for what in this chain, where timeouts are handled, how long sockets are opened and closed. A book, an article maybe? There is a lot of documentation on each individual component, but I can't find a "walkthrough".