Using PHP with a MySQL Database

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
BobH - TAN
Forum Newbie
Posts: 20
Joined: Mon Mar 20, 2006 7:09 pm
Location: Texas

Using PHP with a MySQL Database

Post by BobH - TAN »

Howdy All!

Been awhile, but I'm still just as ignorant as I was the last time you saw me.

I need help using a MySQL database I've created. The database contains the names of all my high school classmates along with other information. Here are some things that I'd like to do:

-- Whenever anyone wants to register on the forum (Simple Machines Forum based on PHP) on our class web site, I'd like to check their name against the database before registering them. Only registered users can post. My intent is to allow only classmates to register. I'm aware that I might have to do some extensive code extensions to the SMF scripts to solicit names that will validate against the data and that it might take a dialog.

-- In the primary table for the database, I've included filenames that identify .jpg files where individual yearbook photos are stored. From various pages on our site, I'd like to be able to take entries from forms (built with HTML), access the database to find an image filename then retrieve and display the image using PHP. I will also build other tables that will either contain data or contain pointers (filenames) to data that I will want to retrieve and display. For example, I will have pages on the site that will solicit personal history information. I want to be able to store that information in tables in the database and display it based on queries from users (after validating that the user is a classmate). This functionality will allow folks to catch up with each other using the website. They'll be able to see pics from 'then' and 'now' and read about marriages, children, grandchildren, careers, etc -- sorta like an organic yearbook almost 50 years later.

These are a coupla examples. There'll probably be more when (if) I get past these challenges.

I lack the PHP skills to do this from scratch, despite having done several tutorials and written some simple scripts. Can anyone point me to some code examples that do similar things that I can then modify and adapt to my purposes? I seem to learn better this way than by struggling to overcome the many blocks -- gumption traps (anybody else here a fan of "Zen and the Art of Motorcycle Mechanics"?) -- that I encounter every time I try to write code from scratch.

TIA
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

My first thought would be to google 'Simple Machine Forum Hacks' or 'Simple Machine Forum Mods' to see if anyone has done this yet. Then I would probably google some key words on the next few steps of your project.

After not finding anything :wink: I would begin the daunting task of creating the code myself.
Post Reply