A cry for help

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
Treetaliano
Forum Newbie
Posts: 4
Joined: Thu Sep 12, 2002 3:34 am
Contact:

A cry for help

Post by Treetaliano »

I need to learn PHP and databases. If I had those skills, I would be so much more succesful with my web designs. What I usually do, is make the html templates, and then hire someone, usually expensively, to do the PHP and MySQL bankend.

Unfortunately, my programming skill is ZERO. Ok, maybe not zero, I do have a little bit of PERL experience, but it mainly comes in the form of downloading prewritten scripts, and lots of trial and error in editing them using common sense and drawing on my experience of BASIC which I learned when I was 6 years old!

I have browsed hours on the net looking for help in this sort of thing. I have downloaded programs, I have read hours of documents and "manuals", and still, I am no further along than where I started. Programming and databases are more of a mystery to me than women are. I'm absolutely CLUELESS.

So basically, I need to learn this stuff as soon as humanly possible, but I have NO IDEA where to start. Let me tell you first what I have done thusfar.

First thing I did was download something called mySQL Max version 3.23.49 directly from the website of mysql. I was under the impression that this program would be something along the lines of MS Access in the standpoint of user interface, and it would allow you to create tables etc. (I do know how to create some rudimentary tables in MS Access). So after I installed this program, I clicked on the icon to start it, and to my surprise, the only thing that happened was the an MS-Dos box popped up for about 2/10ths of a second and then disappeared. So to me it was a waste of 2 hours of downloading.

After a bit more of prodding I saw that there was some configuring to do. For the life of me, I have no idea where to look, and even if I did, I wouldnt have any idea what I need to configure anyways. Basically I want to have this installed so that during my learning process of PHP, I can test and run things on my local machine, and not have to connect to the internet, upload files etc.


Secondly, I downloaded something similar, called Easy PHP. The website said it would install this and that and then something else that would allow you to run PHP scripts on your local machine as well as being an editor to help you write scripts. So I downloaded this as well. So 27 MB and 3 hours later I have yet another useless program with no interfaces nothing. Just something that runs in the background.

So now I talked with my roommate and explained these issues to him. He pointed me to a software called CodeCharge. So I downloaded that and spent hours looking through the "templates" and what not, and although I can see this is a step in the right direction, it still leaves me with more questions than answers. It wants me to specify DNS or ODBC or ASPI etc etc and I have no clue what that is, what it means or what is does.

Furthermore I see no way to use existing html files that I have created as templates. Just existing ugly templates that come with the software. I'm sure there is a way to do that, but I haven't figured it out.

So what are my questions? Basically want to do is create sets of HTML templates for various sections of sites. Then using the templates, code the PHP to pull the correct information from a database, manipulate it, and then return it together with templates. For example. On this a site that I am now working on, there is a section that will contain headlines to various news stories. In the HTML it looks something like this:


<A HREF="1.htm">HEADLINE</A><BR>
DATE

All this would simply create is something that looks like this Below:

Headline
September 12, 2002

Obviously clicking the headline would take you to another page that would give you the entire story. To me, drawing on common sense, what you are really saying is this:


<A HREF="1.htm">{LOOK IN THE DATABASE FOR A HEADLINE AND PRINT IT HERE}</A><BR>
{LOOK IN THE DATABASE FOR THE DATE OF THE ABOVE HEADLINE AND PRINT IT HERE}

Makes sense no? So really for this template, it would use 2 sections from the database: "Headline" and "Date" and the PHP tells the server where to put what depending on which templates is being used

I don't want to drag this on, but in other words for these sites that I am creating there are basically 1 thing that I need to accomplish.

#1 is that I need a "control panel" that is somewhere that I can go to any computer and log in to. When I do that I can log-in and that will bring me to and ADD/EDIT/DELETE form for any section of the site, and if I go to add, then I will type the various bits of info into it, click submit and automatically that info is added to the database. The edit and delete features are self explanatory, but the end result is simply saying that OK, now I've entered the info into the database, Now, Mr. Server and Mr. PHP when the time comes for this info to be used, you have the info.

To me this isn't brain science in concept, but I have no friggin idea where to start. So? Where do I start?

Ok, so hopefully you've read with me so far. And I do appreciate it as always. So now, let me pose my actual questions.

Creating a mysql database:
#1 What do I have to install on my machine to be able to eventually run the scripts on my local machine? Where can I find it?
#2 How do I set it up?
#3 Is there a software that has a user interface such as MS Access that creates the actual database? If so, where can I find it? If not, how do you actually create the database?

PHP scripting
I have downloaded various "manuals". The one I've seen most mentioned is the one at PHP.net, so that is the one I have. I can understand certian parts of it. But it's all in PHP speak. What I need to learn first, is knowing when to use what. Look at this code below:

class news
{
var $entries;
function news($disp)
{
global $news, $news;
$tp = fopen($news['template'], 'r');
$loop_code = fread($tp, 4096);
fclose($tp);
$count = 0;
$this->entries = '';
foreach ($news as $entry) {
$data = explode('||', $entry);
$data[1] = date($news['tformat'], $data[1] + $news['toffset'] * 3600);
$this->entries .= $loop_code;
$this->entries = str_replace('{timestamp}', $data[1], $this->entries);
$this->entries = str_replace('{author}', $data[2], $this->entries);
$this->entries = str_replace('{authoremail}', $data[3], $this->entries);
$this->entries = str_replace('{subject}', $data[4], $this->entries);
$this->entries = str_replace('{body}', $data[5], $this->entries);
$count++;
if ($disp != 'all') {
if ($count == $disp) {
break;
}
}
}
}
}


To me it's just a jumble of characters. Why are things indented? Why are some things inside quotes and others not. What is a global variable? What does parse mean? etc etc. Some many questions...

I do know what a variable is, and I know that the above coding is just basically manipulating them. I have managed to "write" one simple script, borrowing some code from a prewritten script that will take the contents of a 5 field html form and print them in a text file like so:

|match date|match time|Home team|Away team|match result

So I managed to figure out what fopen(), fread(), fwrite() and fclose() are. So now that I have this text file on the server, I want to be able to manipulate the info between the | character. If I can figure out how to do that, I can learn the syntaxes and coding functions fairly quickly.

I know using an editor is "cheating" in a sense, but I also know that I can learn the same way I learned BASIC when I was 6. By deconstructing the code. I really need to learn this stuff. I have no idea where to start and it's really making me lose time and money. I don't want anyone to hold my hand and do it for me, I need to know where to start. I have no idea what to do, but downloading MB after MB of software that doesn't teach me anything isn't going to help me get to where I need to be. Honestly I think I can learn this fairly quickly with just a little bit of guidance. It's tough when you go to a PHP channel on IRC and all they tell you is "read the F*****G manual!". I just don't want to be fiddling with SSI and text replacers for the rest of my life, if you know what I mean.

Anyone who has any thoughts, please reply via email or this forum. I sincerely appreciate it.


Cheers,
Chad in Florence, Italy cwinger@callistonet.com
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

first of all: calm down, take it easy. try not to jump at it.
Seems like you want it all at once. Choose one thing and try to understand it before you're going to take the next step.
You said that it is "more of a mystery to me than women are". I think one thing that women do not understand about men is, that they never read the manual ;)
Since you found your way to this forum (btw: hi) I suggest to take a look at the tutorial section of this site.
as well as
www.zend.com
www.phpbuilder.com
www.devshed.com
(you already downloaded EasyPHP, so: ) easyphp.net tutorials

and the manuals at
www.php.net and
www.mysql.com


p.s.: you already downloaded and installed a bunch of software packages and probably now there's more runnning on your box than you think. I suggest not to install more of this until you've understood what you've done :wink:
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

A nice way to get a feel for PHP/MySQL is "MySQL/PHP Database Applications" by Jay Greenspan and Brad Bulger.

No, I don't get commission, I just found it useful when I started heading towards the slightly more complex bit of PHP. As I hate to read manuals (hello, women ;p) I skipped some chapters because I thought I had enough experience in those fields, but at some point browsed through them and thought: "Hmm...nice introduction to the topic."
User avatar
Crashin
Forum Contributor
Posts: 223
Joined: Mon May 06, 2002 3:42 pm
Location: Colorado

Post by Crashin »

I agree, about hating manuals, but I think you'll be best off and save A LOT of time if you get yourself a good book and just start going at it. "PHP and MySQL Web Development" is a good one. It goes from installation of MySQL, PHP, and a web server all the way through to building some fairly complex applications. If you worked at it, you could probably get through the whole thing (it's pretty big) in about 3 - 4 weeks, and have a good understanding of what you want to do. (Don't be disheartened...this is a SHORT learning curve for the fundamentals of a brand new programming language to someone with virtually no coding experience.)

And, no, I also get nothing in return for the above recommendation.

You could also check out the "PHP Bible," but I use it more as a reference than anything else. It also doesn't cover MySQL basics as much as the other book mentioned.

Stick with it...good luck! :)
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

What I recommend is just buy a PHP beginner book and after that just use PHP manual!
Post Reply