TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,970
  • Latest: bynw
Stats
  • Total Posts: 196,055
  • Total Topics: 21,337
  • Online today: 118
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 119
  • Total: 119

How about a FORM? PHP Article or Block Code

Started by rumboogy, April 02, 2008, 08:50:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JPDeni

QuoteOh...and by the way...how'd you like what I did with it?
Very nice. (Sorry I didn't say anything before. I was heading out to an appointment.)

Quotene other thing I would like to say...your instructions were GREAT.
Thank you!  :) Sometimes I'm afraid that people might be offended because I write such basic instructions, but then I figure that it's better to overexplain than to leave questions.

So... next on the list is to
add a function to empty the table -- admins only -- with an "are you sure" page
add a title
add intro text

I'll just set up variables at the beginning, like I did with the tables.

Centering the values in the table is easy. I'll add it to the code.

Once I have those going, I'll think about the admin interface. I know how to do it, but I want to be sure everything else works first.

Quote
QuoteThere could be databases which aren't based on memberships, but on something else.
Explain that one...what will this do? Maybe an example?

Well, I have a database just for myself (written in Perl, with just a text file for the database) which has aquarium fish. I've been collecting information about fish that I might like to keep in my aquarium and it's easiest to keep the info in a database. It's a whole lot more involved than just the table printout that this one displays. This is all way down the road, though. You're really helping me to develop an application that a lot of others could eventually use for a whole lot of other things.

I may not be doing much tomorrow. Depends on if I can manage to get any quiet time while the Mr. is home playing video games.

BTW, that avatar of me was taken nearly 40 years ago!  ;D

rumboogy

Great, I look forward to the enhanced version...very nice.

As for the avatar...actually funny thing, when I first looked at it, I was reminded of how MY photos looked when I was 16-18 years old (in other words HIGH SCHOOL).

Of course I would NEVER ask a lady her age, but I know mine were taken in 1973...I would assume yours were taken sometime about 10-15 years later...how's that for diplomacy. Just curious though...is that a year book photo?

rumboogy

There you go...my avatar is now my senior picture.  :2funny: :2funny:

JPDeni

I just realized this was in the Feedback forum. I've moved it to Block Code Snippets.

The code is updated. http://www.tinyportal.net/index.php?topic=22934.msg186613#msg186613

Changes I made:
can have checkboxes
can have optional fields (not all fields are required)
added page title
added intro text for table and form
centered table and form on page
centered values in table cells
added "clear database" function for admins
added optional "delete entry" for users

Let me know if there are any problems.

As for the pictures and age thing, you young whippersnapper ;) I got you beat as far as age goes. My avatar was taken at a friend's house during either the fall of '68 or the spring of '69 -- my senior year in high school.  ;D

rumboogy

Hi Deni...I shot a Track Meet today, so I have been busy working with the pics and all..I will try and look at (and test) this new version tonight or tomorrow night.

Thanks again...I will respond later.

Wally

rumboogy

Deni...hope all is well. I think I just found a small issue with this database. When you clear the database...it appears that it clears ANY other PHP article where you have this database, even though they may have different field names.

Is that the way it is supposed to work?

Thanks...

Wally

JPDeni

It's supposed to empty the table. What else is it emptying?

rumboogy

I had made 2 different php articles and when I emptied one...it emptied both articles...even though they had different field names. If this is the way it is supposed to work...that is fine, I'll know next time to just inactivate them until I can empty them all.

Again...it may work that way and that is fine, but I thought it would only empty the tables by field names in a particular db. I assume these all go into the same db though.

Thanks,

Wally

JPDeni

QuoteI had made 2 different php articles

That's the problem. I was pretty sure that I mentioned you could only use one database on a site with this script.

A workaround is to create a new table for each database. In the original code, the table is called db_data. Do a search-and-replace in the script to change the name of the table. Something like
db_data01. Just make sure that there is a table with a different name for each database you're creating.

rumboogy

Not a problem..."A man's gotta know his limitations" from a Clint Eastwood movie and appropriate here....it is working VERY well...LOVE IT.

THanks,

Wally

This website is proudly hosted on Crocweb Cloud Website Hosting.