Skip to content

Tag: database

Automatically insert Line break?

I’m making a news posting system and I was wondering if it is possible to automatically insert a <br /> tag where ever there is a new line? For example, if posted a news article with the following text in the text area: it would add this to the news database: Is there a way to do this? Answer http…

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…

Doctrine 2: Update query with query builder

Hi I’ve got the following query but it doesn’t seem to work. This returns the following error message: Fatal error: Uncaught exception ‘DoctrineORMQueryQueryException’ with message ‘[Semantical Error] line 0, col 38 near ‘testusername WHERE’: Error: ‘testusernam…

PDO looping through and printing fetchAll

I’m having trouble getting my data from fetchAll to print selectively. In normal mysql I do it this way: In PDO, I’m having trouble. I bound the params, then I’m saving the fetched data into $rs like above, with the purpose of looping through it the same way.. Now comes the trouble part. Wha…