|
|||||||
| PHP Discussion and technical support for using and deploying PHP based websites. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
mysql data is not showing up (messy scripting?)
here is my messed-up code:
PHP Code:
PHP Code:
and for those items I want to list a couple of their fields: press_source and press_date (date is a varchar here...) I cannot understand what am I doing wrong, how to fix... If someone could explain it to me, please...
__________________
Absense of a result is a result, unless defined otherwise. Open Source to Beat Global Piracy Last edited by Daria; 07-12-2005 at 04:55 PM. |
|
#2
|
||||
|
||||
|
This line...
PHP Code:
PHP Code:
PHP Code:
__________________
"That's what the gods are! An answer that will do! Because there's food to be caught and babies to be born and life to be lived and so there is not time for big, complicated, and worrying answers! Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." -- from Nation, by Terry Pratchett freelancer.internet.com Email me |
|
#3
|
||||
|
||||
|
Thanks for such details!
on the sad note, I still get the blank page... This time I don't even get the <tr> portion of it that is supposedly generated.. i.e. the following line is missing PHP Code:
__________________
Absense of a result is a result, unless defined otherwise. Open Source to Beat Global Piracy |
|
#4
|
||||
|
||||
|
ok, SUPER-SIMPLIFIED version.
I have just one item, with id = 0 here is the page where I don't get to see anything. Please, explain to me what am I doing wrong? PHP Code:
__________________
Absense of a result is a result, unless defined otherwise. Open Source to Beat Global Piracy Last edited by Daria; 07-13-2005 at 02:27 PM. |
|
#5
|
|||
|
|||
|
With this, you can only get one result.
You should really use what NogDog said: PHP Code:
|
|
#6
|
||||
|
||||
|
I tried NogDog's advice and was still getting a blank page!... I don't know why it didn't work for me.
anyway, I just solved it... I scratched the whole thing and re-did it step-by-step (plus including counting rows thing...) and got some results. Now all of my records (now 3, I added 2 more) are displaying. It's a start ![]() so, here is what I ended up with: PHP Code:
In the end, when I'm done with this one, I would like to have a relatively complicated task to be done, I have 3 tables, one for articles (press_items), one for the years articles were published in (press_group), and one for the article type (press_type). I would like to have visitors to view articles in 3 ways: all by type, all by year, and narrowed results by both: certain year for certain type... I'm still learning and would like to attempt to write the whole thing by myself - so this process would be a perfect hands-on experience. I would appreciate some pointers when I do something wrong, as well as a helping hand to explain why certain things I am doing are incorrect, and why the correct ones work... Anyway.. THANKS FOR INPUT!
__________________
Absense of a result is a result, unless defined otherwise. Open Source to Beat Global Piracy Last edited by Daria; 07-13-2005 at 03:21 PM. |
|
#7
|
||||
|
||||
|
Let's do some defensive coding (which is always a good idea) and find out where the problem is:
PHP Code:
__________________
"That's what the gods are! An answer that will do! Because there's food to be caught and babies to be born and life to be lived and so there is not time for big, complicated, and worrying answers! Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." -- from Nation, by Terry Pratchett freelancer.internet.com Email me |
|
#8
|
||||
|
||||
|
HOORAY! this one worked, NogDog
__________________
Absense of a result is a result, unless defined otherwise. Open Source to Beat Global Piracy |
|
#9
|
||||
|
||||
|
OK, here is the question of the day....
why in some examples we put $query = "Select..." etc on the top, outside of <html> tag, and in some examples into <body> ?
__________________
Absense of a result is a result, unless defined otherwise. Open Source to Beat Global Piracy |
|
#10
|
||||
|
||||
|
Quote:
__________________
"That's what the gods are! An answer that will do! Because there's food to be caught and babies to be born and life to be lived and so there is not time for big, complicated, and worrying answers! Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." -- from Nation, by Terry Pratchett freelancer.internet.com Email me |
|
#11
|
||||
|
||||
|
thanks
__________________
Absense of a result is a result, unless defined otherwise. Open Source to Beat Global Piracy |
|
#12
|
||||
|
||||
|
EDITED:::: BEFORE READING THIS, PLEASE, READ MY NEXT POST BELOW FOR A SHORT VERSION OF THIS GIBBERISH
![]() ======================================================= OK, here is the follow-up question. Now I am modifying the call to pull up only certain IDs In this case I change PHP Code:
PHP Code:
Now, here is the tricky part: press_page is an actual part of a url, like file-article-type-one.php so the links show up like something like this: PHP Code:
Now, in that press_room folder, I have one file, press_template.php that goes like this (simplified version) PHP Code:
file-article-type-one.php (that's what is submitted into a DB as press_page) and a title Article - Type One (that's what is submitted into a DB as press_title), it takes a press_template php (code above) and literally creates a page called file-article-type-one.php. So I am relying on this line PHP Code:
Now $data (actual content of an article) is not showing up. I suspect it is because of something I missed to accomodate for an extra folder in the path or something, or something equally simple.... Please, help me figure out this one, too... !!!!!!!!! I spent 2 days trying to move files around and see if having files in our out of press_room/ folder it makes any difference, and no luck so far. what's up?
__________________
Absense of a result is a result, unless defined otherwise. Open Source to Beat Global Piracy Last edited by Daria; 07-14-2005 at 11:27 AM. |
|
#13
|
||||
|
||||
|
I guess the real question and a short version of what I am asking is
how to eliminate /press_room/ from that PHP_SELF? and read only what's after the latter / ? If it cannot be done, I guess, as an alternative, I can include /press_room/ to be a part of the press_page field, so it would go as /press_room/file-article-type-one.php instead of just simply file-article-type-one.php....
__________________
Absense of a result is a result, unless defined otherwise. Open Source to Beat Global Piracy Last edited by Daria; 07-14-2005 at 11:34 AM. |
|
#14
|
||||
|
||||
|
PHP Code:
__________________
- My Home - Resources for PHP and MySQL :: Please Use The Proper Tags to Format Your Code, PLEASE! |
|
#15
|
||||
|
||||
|
ihhh
![]() now, how do I tie it in with PHP Code:
__________________
Absense of a result is a result, unless defined otherwise. Open Source to Beat Global Piracy Last edited by Daria; 07-14-2005 at 02:02 PM. |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|