Just wondering what the best way of storing currency values and symbols within a MySQL DB might be? Thanks to browsing SO, I’m storing my amounts as a Decimal (19,2) value – which is fine – but am …
Tag: mysql
How to ‘really’ detect integers from DB?
I’m trying to save some code with the following. I’ve an object with variables named the same as table rows so I could create an insert like this one: $query = “INSERT INTO table “; $columns =…
Purpose of Secondary Key
What is the purpose of the Secondary key? Say I have a table that logs down all the check-ins (similar to Foursquare), with columns id, user_id, location_id, post, time, and there can be millions of rows, many people have stated to use secondary keys to speed up the process. Why does this work? And should bot…
How can I loop through a MySQL result set more than once using the mysql_* functions?
For whatever reason, I need to go through a MySQL result set twice. Is there a way to do it? I don’t want to run the query twice and I don’t want to have to rewrite the script so that it stores the rows somewhere and then reuses them later. Answer This is how you can do it: However, I
How does facebook calculate mutual friends? [closed]
Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 11 years ago. Improve this question In your opinion, how does facebook calculate mutual friends? Has it cached all mutual friends for …
Error in mysql fetch error in php
Hi when i run my code this proplem apper this is my code Answer rewrite so this: becomes this:
“Invalid parameter number: parameter was not defined” Inserting data
I’ve been using Yii’s active record pattern for a while. Now, my project needs to access a different database for one small transaction. I thought the Yii’s DAO would be good for this. However, I’m getting a cryptic error. CDbCommand failed to execute the SQL statement: SQLSTATE[HY093]…
How do I get NULL into a MySQL integer column with PHP/MySQLi?
I’m passing values into a PHP page through the URL and using them in queries with MySQLi. The problem is that an empty string gets converted to zero for an integer column, when in fact it needs to be NULL. How do I get NULL into an integer column with PHP/MySQLi, from a param passed in the URL? Update: …
Any good PHP MySQL-compatible reporting frameworks out there? [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 2 years ago. Improve this ques…
Excel output with codeigniter
I’m trying to get a report from my codeigniter project in excel, but I am at a complete loss on how to do it. It already works well, just would like the output in excel rather then a page. Any tips/pointers/explanations? thanks! Answer I’ll refer you to this wiki article from the codeIgniter site,…