|
Posted by JDS on 08/03/05 03:15
On Tue, 02 Aug 2005 23:30:52 +0000, Neal wrote:
> will print out. But, when I put WHERE school = '$school'"; .... nothing.
> Even though the echo("$school'); line prints out 'Washington HS' (if I
> entered the username and password associated with this school from the
> login table).
I'm just guessing. Not enough time at the moment to get too in-depth.
Does the 'school' column EXACTLY match the value "Washington HS"? If not,
you will get no matches.
It is a Really Bad Idea(TM) to use a string value column to do joins on,
expecially if the string values were all entered by hand. It is much much
better to use an Integer value.
How do you get an integer value for a string? In a RDBMS, you put the
strings in *another* table, in this case, a table called "schools" or some
such.
Then you will do a multi-table join.
I realize that putting all the schools in a third table sounds like extra
work and extra complication, but it will make for a more flexible,
scalable, and programmable database in the long run.
Google a bit on "database normalization"
later...
--
JDS | jeffrey@go.away.com
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/
Navigation:
[Reply to this message]
|