MIST 5990 - Zlatko Unger's PHP Experience

Tuesday, November 14, 2006

Rewriting crappy designed PHP = bad idea.

So, after rewrintg a lot of php and then finding out it does not work because:

1. it does not connect to the database
2. it looks in the wrong file
3. it does not assume that the tables in a database are connected
4. variables do not match since one is a nulll
5. the book explains one way of doing it, the database is designed in an obsolete way


So after I figured out all these things, I decided to modify the current PHP so that it works right, and has comments. For example :

$query = "select * from meetings where meeting_date >= '$timetime' order by meeting_date asc"; //it used to be greater than = to

I also had to make sure that the variables were actually comming back. Echo statement to the rescue. Ex:

//$tempvar = mysql_num_rows($result); error here ... returns a 0
//echo"$tempvar";


Anyway, I am off to import the old pages into the new design so that I make sure that everything works! Hooray!

0 Comments:

Post a Comment

<< Home