Archive for the ‘PHP and mySQL school project’ Category

ITC280 – Adder, etc.

21 July 2009

We got an assignment called the “black adder.”

It was a php code debugging assignment.

The adder is a harmless-looking extremely poisonous snake. And this code was similar. I don’t think adders are black, though.

I worked on this messed-up code for about 2 hours before I realized I had not managed to set error reporting to ON on my local php installation.

By that time I had figured out how to get the code to work.

The essence of it was how php treats quotes – single and double – and how you have to enter html code so that php will echo it correctly.

I couldn’t totally figure it out so I separated the echo commands into the html sections and the variables. I know php echos the values in variables when they are placed in strings within double quotes. However, html needs its attributes double-quoted, so it is better to leave the php variables outside of the quoted html strings.

The bad code was designed to NOT error out in php, so I was trying to figure out what was wrong based on the junk that php was outputting to my browser. But until I took out all my comments and segregated all the different echoed strings I couldn’t make it calm down and work.

After that, I had a problem with isset(). It seemed to test true whether you put anything into the form array or not. However empty() was more sensitive. So I ended up using two conditional statements in my code instead of one. I could then test both if the the submit button in the form had been pushed AND and if the form text boxes had anything in them. If the form was sent empty, even half-empty, I prompted for data. Otherwise I would display the answer string and the reset link. You could enter a non-numeric character in the form and it would still function, but act as if you had entered zero.

populating a database table

My next job was to populate my database table “artitems” in my database “larryart.” This will probably be changed to “lcox0008” so it has the same name as my database at school.

I found out the the punctuation used in the SQL INSERT statement used “`” signs. I thought they were single quotes. MySQL didn’t like that! I’m not sure those characters are required, but I was following how the book author did it. I fixed that and now I have data on 19 pieces of art loaded into my database at home. So now I can play with the code needed to display the art in the browser.

Total time spent: about 4 hours.


ITC280 – more work

18 July 2009

I spent about 7 hours Saturday creating styled forms for my left and right panes based on example code taken from the Liz Castro text web site.

These are basically non-dynamic pages at this time.

I worked out a basic plan for what should appear in these two panes and how it should work.

I also used irfanview to make thumbnails of my image files.

Then I used the instructions from the text to make my first table and add two records.

At this point it’s a cute, patchwork, useless site, but I’m a bit excited because I don’t get a chance to work with my old art very much and it reminds me of what I was thinking and what I was aware of when I was young.


Last night I went to a Scientology event. They are showing the summer “Maiden Voyage” events around the planet at this time.

The church is trying to raise donations from its members to replace all the major urban service organization buildings with  larger, renovated, better-located buildings.

Earlier this year Celebrity Center Memphis got finished.

Seattle is planned to be finished this year.

This expansion push has been hard on many members, as they are trying to pay for their own services plus being asked to finance these buildings. In every area there are a few exceptional members who contribure huge amounts, but everybody is asked to help, and most do donate something. At every event they have a fundraising rally after the event has been shown. And the speakers and major contributors always emphaize something that they have found to be true: you will do well if you stay “on purpose.”

Many beings are confused about or have lost interest in purpose. Some can identify several strong purposes they have that seem to conflict. But if a being can identify a pro-survival purpose that is important to him or her, and get on it and stay on it, this datum will begin to operate.

For example, I had two stronger periods in my life. One when I was a young teenager and one when I was abut 25.  During both those periods I was involved in performing groups. This was actually a major purpose for me. I had a hard time staying on it because I lacked training in it, but when I did things would go better for me.

I also loved to make art. But I was hampered by various factors, and didn’t choose it as my life’s work. I probably should have done so, as I am willing to spend countless hours at art-related work while other tasks go neglected. I hope to find an opportunity to give myself another chance in this direction.

In any case, it is worth heeding this lesson. Most people don’t actually have a deep, abiding purpose to “make a lot of money so I can retire and travel to Europe.” Most people, when they think about it, can recognize more far-reaching puposes in their lives. The best purpose is not necessarily the most practical one. It is the one that lights up your life. If you see someone doing quite well and wonder why you aren’t operating at their level, you might want to consider this subject of purpose.

ITC280 – mySQL install

16 July 2009

It is now Thursday morning. On Wednesday morning (Tuesday “night”) I spent about 4 hours downloading and installing mySQL Windows Essentials (a 38MB file that took more than 2 hours to download over my dail-up connection) and phpMyAdmin (a smaller file). I had not downloaded mySQL at school because I had a copy (the 107MB exe version – “essentials” is an msi file) that I had played around with earlier. However, on this install, the install program reported that one of the cabs in the exe (a self-extracting zip) was corrupt, so I couldn’t use it. The “essentials” install went fine, though it is technically challenging. The instructions in the text are very important. Data on the web on how to install is inferior.

I then got phpMyAdmin up and functioning. I was going to try one of the other GUI clients for mySQL (mySQL makes their own) but I thought I had better stick with the way the book does it. PhpMyAdmin is a funky way to do it. It’s all in php and the files reside on the server (it’s not a remote client, exactly) and you operate it from your browser.

Google’s New OS

While I was waiting for the download one of the things I read up on was Google’s new OS project. They just recently annownced that they were starting it. From what I can tell, the traditional desktop will basically be replaced by a browser (Chrome). You will do all your navigation, computer maintenance, settings, and computing (of course) from basically a browser interface. Google intends that the vast majority of your software (and your data) will be web-hosted and will not reside on your own machine. I think this is an assumption that will be disagreeable to some. But many already do most of their computing this way. By offloading your storage and computing resources to the “cloud” you can successfully work with grossly scaled-down hardware. The OS software will be built on top of a Linux kernel which will handle most of the hardware-specific work.

When I first started working with Vista (my desktop came with it – my netbook, which I use sort of like a proxy servcr, runs Win XP home) I thought “this looks like a browser!” I believe that all the major commercial players want to push us towards internet-based (or you could say server-based) computing. For some reason, they aren’t discussing the implications of this frankly (as far as I can tell) but only in marketing terms.

The Culture of Freedom versus the Culture of Security

The problem I see with it is that that the internet then becomes, instead of primarily a tool for the computer user, another tool of the new technocracy to control the information and communication channels available to us. The potential, as I see it, is to turn the internet into something that will reduce our freedoms instead of increase them. The technocray, as far as I can tell, is convinced that we are just bodies trapped on earth and that any hope for freedom is only illusory. It’s a sort of Matrix viewpoint, from what I can tell. The people who understand (correctly) that people are basically spiritual beings and innately free and immortal continue to be pounded with accusations of “lunatic” and “fringe,” while the technocracy itself was secretly making contacts and discoveries that could be, if they were widely known, used to support the idea of the workability of personal freedom.

Almost any government cringes at the idea that its populace could actually be composed of free beings. The United States was one of the first societies during this era in our planet’s history to base itself, at least at a PR level, on the desireability and workability of individual freedoms. And look at how we have been attacked for this! But look, also at what we have achieved! With our decision in the 1800’s to free the slaves, which then forced all other countries on the planet to (grudgingly) go along (many never really did it), a society was created that has become the dominant culture of earth. This was not achieved, though it was possibly supported, by our military power. It was essentially a product of our spiritual power – a celebration of the workable truth of spiritual freedom.

The new technocracy, European-based (some say Nazi-based; I don’t doubt it) as it is, does not value or (I think) even understand the power of personal freedom. They gave up on this idea a long time ago, if it ever even occurred to them. And thus we see the current face-off (if you can call it that)  between a U.S.-based group that still values the concept of individual freedoms with a power structure that never did. The power structure is pushing the concept of “security.” Those of us on the freedom side of things believe they are doing this totally cynically. In other words, we think they are fully aware that their concept of a “better” society based on security is basically flawed, but that they do not have the strength of conviction to change their thrust towards this newest brand of slavery. I will probably get back to this in future posts.

ITC280 – forms

13 July 2009

I started getting more used to forms. I spent several hours at it over the weekend. I used Liz Castro’s sample code (Web 110 text).

This is CSS-intensive code!

So I guess I have a style sheet I can link to if I really want to.

But my emphasis is on functionality. I am also using her form handler right now. It works for me.

I’m nervous, though, that I don’t have MySQL up and running at home yet and that we aren’t yet wrting queries and creating pages with data from databases. I have a LOT of unanswered questions about how this works, and I don’t feel like I have time to read ahead.