When performing UPDATE and INSERT queries using Zend_Db, I frequently need to set values equal to NULL (not ''). However, the default behavior of Zend_Db::insert() and Zend_Db::update() seems to be that values that are empty are translated into empty strings ('') and put into the database as such.
Does anyone know of way to actually fo...
I've got a table with a BLOB collum. What I want to do is get it to be able to pick out words and list them in order.
For example if it contained:
Bob Smith likes cheese but loves reading
Charlie likes chocolate milk
Charl loves manga but also likes cookies
Then I would get
likes
loves
as a result... is this possible and if so h...
Hello,
I insert questions(which might be a few paragraphs) in a sql table using php and than i diplay them on a webpage.
but when i display the question it loses its formatting. I mean it will just show the whole question in one paragraph, even thou there were many paragraphs before.
<td width=\"700px\" bgcolor=\"#EAD57F\"><font co...
What's the best way to get a sublist of things?
I have two tables:
create table A (
id int primary key
)
create table B (
id int primary key,
aid int foreign key references A( id ),
sort_key int
)
I want to get a list of objects A, with subobjects B, but only the top five of B.
Let's say A is people, and B is type of food, ...
How to get the max column size of common column like 'id' across all tables in the Mysql
...
I'm having trouble thinking of a way to do the following join in MySQL. I'm not sure which joins would be best suited for this task, so I'll edit the title when someone points it out. Here's the gist of what I'm trying to do.
I have two tables, call one Students, and the other Marks.
They are setup as follows,
Students
Only the Id ...
I need to put a Case in the Select to check if the Data I'm adding to my view is NULL, in which case I want it to just enter a zero, or not.
...
I am inserting a row into a table and would like to get the value of the automatically incremented primary index.
The primary index is the only unique value in the table so I don't want to do anything like "SELECT [primary index] FROM [table] WHERE [the columns = the data I just inserted]" to prevent ambiguity. I also don't want to SELE...
This is for the friends module on my site, where users can make friends with each other.
These are stored in a "friends:" table, with person who initiated the friendship being the friendship_inviter and the person on the approve/deny end of things is the friendhsip_accepter
SELECT user_id, user_name, user_gender
FROM friends
LEFT JOIN u...
I've been furiously googling trying to figure this out, with surprisingly little luck; I would guess this is a common issue.
I have 5 tables: orders, addresses, notes, transactions, line_items, and shipments.
transactions, addresses and notes all have indexed order_id fields - line_items and shipments have indexed transaction_id fields...
Users table
user_id
pic_url
name
friends table
auto_id
userid
friendid
status
actions table
auto_id
userid
type
subject
body
datetime
I want to make a friend stream of updates thats shows updates, could be a blog post, status change, anything but should only show the ones that are from a friend of the logged in user
Her...
I have a list of TV shows stored in 1 table. Another table stores show genres (action, romance, comedy).
Most shows usually have more than 1 genre, so having a single tv_genre column and putting the genre ID in there isn't an option.
I could create a look up table which would store tv show id + genre id, and I could insert 1 row for e...
Problem: Doctrine test application isn't working because of driver issue.
Setup: Mac OS X 10.5.7 (not server), MAMP 1.7.2, Doctrine 2.2.1, PHP 5.2.6
I am following the doctrine documentation to try to set up a development environment on my local machine. The output of running the page from the web (through MAMP) shows an empty screen (...
Does anyone know if there's a problem with the mysql query browser using connections over SSH on the Mac?
I use the command: ssh -L33306:localhost:3306 user@host then I try to open a connection with the MQB pointing it to localhost port 33306
I get an error "Could not connect to MySQL instance at localhost..."
What's odd is that this ...
How could I improve this query?
Please tell me all my options here as my social network DB is only getting bigger
This Query took 2.1231 sec
SELECT friend_friend.friendid, friend_reg_user.disp_name, friend_reg_user.pic_url, friend_reg_user.online
FROM friend_friend
INNER JOIN friend_reg_user ON friend_friend.friendid = friend_reg_user...
I've deployed a Ruby on Rails application using mod_rails and nginx over Capistrano, and it's working perfectly, but I have a baffling problem.
When I run the following command on the server:
SHOW TABLES IN application_production;
MySQL returns:
Empty set (0.00 sec)
I know that information is being written to the database because ...
I have a field in a table recipes that has been inserted using mysql_real_escape_string, I want to count the number of line breaks in that field and order the records using this number.
p.s. the field is called Ingredients.
Thanks everyone
...
I have a large flat file that I need to process in php. I convert the flat file into a normalized database in mysql. There are several million lines in the flat file.
I originally tried to use an ORM system while importing the flat file. There was a massive php memory leak problem with that design even with careful freeing of objects. E...
It seems that the included T4 templates (or the one in the SVN trunk for that matter) just skips generating SPs for MySQL...
When running StoredProcedures.ttinclude together with MySQL.ttinclude, I get the error "Compiling transformation: The name 'GetSPs' does not exist in the current context".
GetSPs is defined for SQLServer and I saw...
Hi,
I run a Mysql 5.0.26 (Myisam tables). To improve the search results, I am doing some fine tuning. I have noticed that the characters considered as word characters do not match the constraints of (Swiss-) French... and English too. :(
I would like to:
ADD the character "-" in the "word character" list
REMOVE the character "'" from...