Creating a simple system.

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
al3x8730
Forum Newbie
Posts: 5
Joined: Tue Jun 24, 2008 11:32 am

Creating a simple system.

Post by al3x8730 »

I wanted to create something simple, I already made a base, but I'm not sure it would fit with what I need help with.

I was thinking something like this: You can type in a name and it will display information that people wrote about that person. And you can have the option to add a paragraph or whatever about that person. I know php somewhat, but I'm not good with MySql.

I did something SUPER basic.


Code: Select all

<?php
 
$username = $_POST['username'];
 
 
 
if ($username == "example") {
 
echo "information about this user";
 
} else {
 
echo "No user was found"; 
 
}
 
?>
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Re: Creating a simple system.

Post by matthijs »

So what is your question?

And you should post this in the Code forum if you have a question about the code
User avatar
greyhoundcode
Forum Regular
Posts: 613
Joined: Mon Feb 11, 2008 4:22 am

Re: Creating a simple system.

Post by greyhoundcode »

Not entirely sure what it is you are asking, however here are some ideas for you:

My personal taste is to use a wrapper class to access the database - I feel it makes my code more readable, and consequently easier to debug:

Code: Select all

 
$database = new DatabaseHandler();
$database->Query("SELECT `name`,`city` FROM `userinfo` WHERE `identity`='$userID'");
 
foreach ($database->Rows as $item)
{
  echo "$item <br>";
}
 
Where of course $database is an instance of DatabaseHandler - a class that handles database queries and tidies away unsightly mysql_connect statements etc.
Post Reply