Even though I said I'd do an if else statement, I ended up using another if statement because for some strange reason, the else wouldnt work. So I ended up typing up the whole thing.
However the phrase "No results" also appears on pages with results. This is because some of the comments are not for that specific photo...
Therefore I'll need to rephrase everything properly.No taking shortcuts like with the If statement.
I have another idea. I have heard talk of a Mysql function that counts a number of entries. I could count it and if it equals 0 then it could echo "No results"
There. I searched for the Count syntax and this came up. I should try it myself now
Yeah, so now I simply need to get rid of the table headers if there are no results. This will be a matter of CSS visibility (like Block and whatever the other one was called)...hmmm
I've figured it out. I've seen tutorials on how to use javascript to toggle visibility. I could use that
told me how to call a javascript function from php.
So, it's done! It worked!
Now...all that's left (in order of priority)
1) Finish putting photos on site
2) Make graphics for comments section- it needs to look better. It irks me every time I look at it
3) Put it on 000webhost and make databases and tables there
4) Make Tutorial
5) Hand to client
Hopefully I should be able to get this done by the end of this week. I have a holiday on Thursday, and i intend to use it well






No comments:
Post a Comment