[EMAIL PROTECTED] wrote:
Ok, here's what I got. I'm trying to create an entire site that grabs all it's information (Page content, titles, link info, etc.) from a MySQL database. In this site I would like to have sub pages of master pages. For instance, Page 1 is a master page, Page 2 is a sub page of Page 1, and Page 3 is a sub page of Page 2 which is a sub page of page one. Now I would like to display this entire hierarchy if possible. Here's what I have but either I get an infinite loop or it doesn't work worth a damn....

<?
mysql_connect("127.0.0.1","webuser","");
$query="SELECT * FROM PageInfo WHERE PageID>'0' and PageID=$MasterPage ORDER BY PageID";

I might be mistaken, but it looks like $MasterPage hasn't been defined at this point. This should be giving you an error. ($MasterPage gets defined later, but...) If you have your error-reporting turned off, it might not throw the error, so you are getting all the way to your DB. Try turning your error-reporting up and seeing if this causes you problems.


The other thing is I don't understand your query -- why are you selecting where PageID is greater than something and at the same time where it is equal to something else? That is redundant. Finally, in your query, remove the single quotes around the 0. You don't need them, and it may be asking MySQL to treat the 0 as a character or string rather than an integer (and the column type is an integer). I'm not really definite on that last one though (more talking out the butt, I suppose).



Erik


-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to