Is it considered better practice to store a first_name and a last_name in 2 separate columns? or would storing both in 1 column be ok? Answer Only you know that, really. It depends if you’re ever going to need to get those parts of the name back out separately. Storing first name and last name in a single column isn’t
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://www.php.net/nl2br
Database Design For Developing ‘Quiz’ Web Application using PHP and MySQL
So, I’m trying to learn PHP and MySQL (I have a basic understanding of both; I’ve read the first half of both Head First SQL and Head First PHP & MySQL) and I figure the best way to solidify my knowledge is by building something rather than reading. With that in mind, I would like to create a basic webpage
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 both user_id and location_id be
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: ‘testusername’ is not defined.’ in … I would be glad of any help Answer I think you need to use ->set() It’s much safer to
How to find Free world city database in mysql [closed]
Does anybody know where I can find open source world city database that includes: city names in different languages region / state / province country IP address range longitude / latitude
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. What do I do PDO-wise to get
Object-oriented-like structures in relational databases [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last year. Improve this question Folks, For the n-th time in a row, i’m hitting the same old problem again. It’s about “how do I map OOP
How to secure database passwords in PHP?
When a PHP application makes a database connection it of course generally needs to pass a login and password. If I’m using a single, minimum-permission login for my application, then the PHP needs to …