Search found 23 matches

by tdnxxx444
Thu Jul 26, 2007 1:53 pm
Forum: PHP - Theory and Design
Topic: sets and gets?
Replies: 18
Views: 4136

You should use accessors inside your classes as it reduces the coupling inside your classes. Only case where I think you shouldn't is if performance is a big issue.
by tdnxxx444
Fri Sep 08, 2006 5:08 pm
Forum: PHP - Theory and Design
Topic: Calculations / Formatting with MySql or PHP ?
Replies: 9
Views: 2226

Reason I ask is, what if you are using the same query in seperate places for your application. What if you SELECT a date, and in one place you want to format by 01-01-2001? What if in another place you want to format it 01-01-01? How about another, you want do, January 1, 2001? Also, what if you hav...
by tdnxxx444
Fri Sep 08, 2006 4:07 pm
Forum: Databases
Topic: Calculations / Formatting with MySql or PHP ?
Replies: 1
Views: 489

Calculations / Formatting with MySql or PHP ?

When I first started programming, I kept hearing that when doing queries and needing to do calulcations and formatting the data, you should always let MySQL do the work instead of PHP. Is this true and why or why not?
by tdnxxx444
Fri Sep 08, 2006 3:13 pm
Forum: PHP - Theory and Design
Topic: Calculations / Formatting with MySql or PHP ?
Replies: 9
Views: 2226

Calculations / Formatting with MySql or PHP ?

When I first started programming, I kept hearing that when doing queries and needing to do calulcations and formatting the data, you should always let MySQL do the work instead of PHP. Is this true and why or why not?
by tdnxxx444
Wed Aug 23, 2006 12:17 pm
Forum: Databases
Topic: Is this properly normalized?
Replies: 2
Views: 450

Is this properly normalized?

newspaper ----------------- newspaper_id title city state editor book ----------------- book_id title author comic ----------------- comic_id title artist Turned into: entity ------ entity_id title book ----------------- book_id entity_id author newspaper ---------- newspaper_id entity_id city stat...
by tdnxxx444
Tue Aug 08, 2006 12:22 am
Forum: PHP - Theory and Design
Topic: Best practice - database mysql queries
Replies: 43
Views: 16752

Re: Best practice - database mysql queries

Well there are a lot of questions hidden in there and you are covering some important ground in application design as well. At the bottom of it are the subjects of reuse and layering and abstraction. One big question that comes to mind is how and if you are separating your domain layer code from yo...
by tdnxxx444
Thu Jul 27, 2006 2:36 pm
Forum: Databases
Topic: Dbase design question for 2 tables
Replies: 3
Views: 419

Each user is suppose to have various items in his inventory.
by tdnxxx444
Thu Jul 27, 2006 1:54 pm
Forum: Databases
Topic: Dbase design question for 2 tables
Replies: 3
Views: 419

Dbase design question for 2 tables

Was wondering which is there better database design situation:

1.
user
------
user_id
user_name

item
------
item_id
user_id
item_name

2.
user
------
user_id
user_name

item
------
item_id
item_name

user_item
----------
user_id
item_id
by tdnxxx444
Thu Jul 27, 2006 11:23 am
Forum: PHP - Theory and Design
Topic: unnecessary declarations ?
Replies: 4
Views: 962

Well the reason I am asking, is because though the 2nd example can be seen as having unnecessary variable declarations, it may help in the future to know where your variables are coming from.
by tdnxxx444
Thu Jul 27, 2006 11:07 am
Forum: PHP - Theory and Design
Topic: unnecessary declarations ?
Replies: 4
Views: 962

unnecessary declarations ?

feyd | Please use , and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color] Just a ge...
by tdnxxx444
Tue Jul 25, 2006 3:17 pm
Forum: PHP - Theory and Design
Topic: Best practice - database mysql queries
Replies: 43
Views: 16752

Best practice - database mysql queries

Weirdan | Please use , and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color] Lets s...
by tdnxxx444
Thu Jul 13, 2006 11:29 am
Forum: PHP - Theory and Design
Topic: Hiding URL query parameters - encrpytion, session, etc ?
Replies: 16
Views: 2613

Weirdan - What if ANY user can view items shold by a specific user? Do you mean they SHOULD be able to view those items? Sorry, I meant "sold".. typo. But anyways, back to the topic.. That's what I'm thinking. When using GET instead of POST, the user can still find the hidden variables in...
by tdnxxx444
Wed Jul 12, 2006 6:24 pm
Forum: PHP - Theory and Design
Topic: Hiding URL query parameters - encrpytion, session, etc ?
Replies: 16
Views: 2613

You don't have to use querystrings. I did away with querystring passing and went to forms, even for things like this. You can also use javascript form submits using links so that it simulates what you are used to. Passing any type of sensitive data, especially data that manipulates database informa...
by tdnxxx444
Wed Jul 12, 2006 6:23 pm
Forum: PHP - Theory and Design
Topic: Hiding URL query parameters - encrpytion, session, etc ?
Replies: 16
Views: 2613

astions wrote: Sounds like poor design actually.
What would be good design then?
by tdnxxx444
Wed Jul 12, 2006 6:17 pm
Forum: PHP - Theory and Design
Topic: Hiding URL query parameters - encrpytion, session, etc ?
Replies: 16
Views: 2613

Weirdan - What if ANY user can view items shold by a specific user?

jamiel - Wouldn't id's be considered sensitive data though? Since the id's are usually primary keys to certain tables and when given a primary key, hackers are given a gateway to modify, access certain data?