-
Pet Projects
Tag Archives: MySQL
A little bit slow but it gets the job done. I used this to generate a report to get the total open_amount for customers. SELECT s.parent_no, s.parent_name, t.parent_no, t.col_manager, t.invoice_date, t.due_date, t.over_7_date, t.over_7_by_eom, t.open_amount, (SELECT SUM(t2.open_amount) FROM transactions t2 … Continue reading
I woke up today thinking about how to handle strings when inserting to MySQL. What if the string I am trying to save into the database contains HTML characters? Let’s say you are using FCKEditor, how would you “generally” handle … Continue reading
Sometimes, we need to update values of tables from the values from another table. Here is an example: UPDATE `transactions` t , `tran_daily` daily SET t.col_manager = daily.Col_manager, t.invoice_date = daily.Invoice_date, t.due_date = daily.Due_date, t.po_no = daily.Po_no, t.remark = daily.Remark, … Continue reading
I have no idea. You tell me. All I do is this: $sql = "SELECT * FROM Table1 WHERE id=’".$target_id."’"; /*That is $target_id inside single-quotes in the SQL Query.*/ Please share your thoughts below.
Here is a very interesting post regarding LAMP (Linux, Apache, MySQL and PHP). I agree with the post all the way. So whats the problem here? Well I think one of the key issues is that LAMP focus on solving … Continue reading
I deal with a lot of database dumps. So this post is a must for me. We seriously see a ton of customers coming in with the type of databases that are a nightmare to move over. When you’re dealing … Continue reading
From jansch.nl: This is not the best way to escape data. The most important reason is security. addslashes can lure you into a false sense of security. As Chris Shiflett points out, there are situations that addslashes doesn’t escape. Use … Continue reading
What is a Singleton? In software engineering, the singleton pattern is a design pattern that is used to restrict instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the … Continue reading
It is Saturday night and it is raining like it hasn’t rained in weeks. So I decided to spend the night to work on my pet project: MyLyricsFinder.com. It uses the Zend Framework. The latest addition tonight is Zend_Cache. I … Continue reading
Last October 8, Apache Friends released new versions of XAMMP for Windows, Linux and Mac OS X. I use XAMMP on Windows, but for Mac OS X, I use MAMP – the Mac OS X release of XAMMP is still … Continue reading