Tag Archives: web development

Puzzling Through PHP, part 1: Give Variables a Value

puzzlingthroughphp1
PHP is a strange animal, as I’ve noted before. And, since most of my webdesign and development experience is self-taught and I’ve mostly worked with front-end design in HTML and CSS, PHP has been more of a frustrating puzzle than a new horizon in my coding skills.

Because of this, I’ve run into a couple of PHP fails in my attempts to teach myself this new language. That story follows!

Problem: Can’t Search My Own Database

I couldn’t understand why my variable-laden code for a simple database search wasn’t working, since I had gotten the majority of the code off a fairly reputable PHP code website, and I thought I’d input all the variables correctly. But the code continued to return an error, saying that the database was not “a valid result resource.”

Debugging with a Good Friend

One of my good friends is a computer programmer by nature, and though he knew little of PHP at the time, he was able to express one of the fundamental truths of PHP in a way I could understand it. “Basically, PHP sounds like a function-based language,” he said. “You tell it things to do–functions–based on the variables and values you give it.”

What this meant to me: if the variable isn’t right, or you haven’t got a way to give the variable any value, you’re in trouble! Certainly I had already run into that problem when I was trying to make the PHP code search the MySQL database; the darn thing just wouldn’t budge, and now I knew at least one reason why.

Solution: You MUST Be VERY Specific When You Work with PHP

Once I finally understood that I had to give PHP a variable’s value before I could ask it to make that variable jump through flaming hoops, one of the main problems in my searchable database became clearer: somehow, one of the variables that related to the database was not being given a correct value. Otherwise, what else could be making the database an “invalid result resource?” (We eventually discovered that the database connection itself was to blame–I had mistyped ONE comma as a period, and the whole code had gone bonkers as a result.)

It may seem like common sense to people who have already mastered PHP and MySQL, but for a non-mathematical person who would have preferred to leave variables back in algebra where they belong, it was a very tough hurdle to jump. Even realizing this small piece of information was a victory.

Whenever you work with a highly technical language like PHP, remember that it is unforgiving of most errors. Double- and triple-check your code, testing it often, to make sure your changes actually work. And please, for the sake of your eyeballs and blood pressure, make sure your database connection works so that your database variable has a proper value!

Next Up: The Triumphant Fixed Database

Thankfully, this wasn’t the end of the story! Head on over to Part 2 of this article to see how we transformed this broken database script into a functioning one! (Samples of PHP code, oh my!)

For More Info:

PHP Variable Explanation @ W3Schools.com (low-tech explanation)
PHP Variable Explanation @ PHP.net (high-tech explanation)

The Difficulty of Pricing Design Services

pricingdesignservices
Doing web design as a career and not just as an (expensive) hobby is something I’ve been tumbling about in my mind for quite some time now. Instead of watching money go down the drain every month for hosting, and every year for my domain name, why can’t I use my skills to monetize my sites?

But it’s a harder decision than that. There are, as I’ve unfortunately found out, many roadblocks to making a success of yourself in web design, not the least of which is the knowledge required to do it. But for those who wish to pursue it as a career, there’s one final hurdle to jump: how to price your design/development services?

Today’s article focuses on the 4 most important concerns any would-be designer/developer needs to figure out before jumping into a career:

#1: People need economical services, not exorbitant prices.

As much as you might think you’ve trimmed costs, somebody will always want the price lower. These days, most people can’t afford to pay a web designer/developer much money unless they are part of a corporation. You have to find the balance in pricing between “selling yourself too short” and “never getting any clients.”

I found this very difficult when I was trying to price my designing abilities. I generally overshot what most people wanted to pay for maintenance services, and undershot the original layout and development price. Finally, I took to writing it all out: what I valued my coding skills at, what I valued my graphic design work at, etc. I came up with a list of prices I could live with:

HTML/PHP Coding (Page Coding Structure)

  • Each Page of Content: $10.00
  • Main Page Layout Coding: $12.00

Graphic Design of Page (Visual Layout)

  • Each large image (layout pieces): $20.00
  • Each small image (icons, buttons): $10.00
  • Full layout (1 page, with images and appropriate coding): $35.00

Layout Mockups

  • Each mockup beyond the first: $7.00

Are these prices exorbitant or economical? To be honest, I’m not sure. But I have strong reasoning behind each of my prices. Given that it takes me about 30-45 minutes to put together a fully-debugged page of anything, and 45 minutes to an hour to make small images of any good quality, I reasoned that 10 bucks covered that time investment that I put into creating a quality product. I then scaled up the prices on large images, full layouts, etc., using these price baselines.

You’ll need to determine what your own prices will be for yourself, taking into account how much money you need to make and how low on prices you’re willing to go. Since I want to help individuals and maybe a few small start-up businesses, I wanted to make sure my prices would be accessible; your price reasoning and money goals may be different.

2. How much work do you want to put in?

When people say “I need a web designer,” they sometimes mean that they need a little HTML-driven personal site, and sometimes they mean that they need a huge database-driven multi-user site. You have to determine for yourself what kind of work you want to put in. If working for the “big guys” fires your engines, then by all means go for it! Just remember that it will be a LOT more work than likely any of your personal web design projects have been.

You also have to take your lifestyle and current available time into consideration. If you want big-money projects, but web design is only a side business for you, you will likely run into trouble trying to keep up your time commitments. Web design is one of those things that you can dip your toe into or dive in completely and still be okay; however, you have to take on the jobs that are sized for your time allotment.

For me, personally, I am not experienced enough yet in design to where I’m comfortable pitching my skills to corporations and the like; likely, they would not even look twice at somebody like me who’s completely self-taught in this field. I’m more comfortable working with individuals who need personal sites and perhaps small business sites because I simply don’t have the knowledge yet to do large-scale sites. Neither do I have the time allotment in my schedule as of yet to completely devote myself to a web design career–I have many different interests and am enjoying pursuing them all. Thus, smaller projects work better for me overall.

3. Do you do design, development, or both?

This is one of the huge stumbling blocks I found when first trying to decide on pricing my designs. Did I want to do just layouts, icons, and buttons, or did I want to do just HTML and PHP coding? Or, instead, did I want to offer both types of design services?

For people who do one or the other very well, you may be better off to go ahead and specialize in either the graphic design side or the coding side of web design/development. If you have wonderful visual design skills, then you might have a great career in web graphic design awaiting you. Conversely, if you’re a “code ninja” and can make sites that function beautifully with scripts and databases, you can easily specialize in web development with no problem.

Now, if you’re a designer like me with some skills in both web design and development, you’ll likely want to offer both design and development services, so as not to shut out clients. I don’t do awesome digital illustration, nor do I write my own super-sleek web applications, but I can write HTML/CSS and design a page. These skills are still marketable, regardless of the methods.

4. Don’t sell yourself short—make a contract!

When trying to figure out how to price design services, don’t let anything slide by for free. Some unscrupulous customers may want you to do more than you first bargained for, such as saying “Well, I thought icons and buttons would just come with the layout design–can you go ahead and make me some?”, or “Hey, can you add about 5 more pages? I just realized I need more pages about these other topics.”

That’s why I suggest making a contract beforehand, so that both you and the client know exactly what needs to be done and how much money it will cost. Getting the contract in unalterable writing, either on paper or in a PDF file, keeps anyone from falsifying the contract terms later. That way, if the client wants you to do something extra that’s not on the contract, you can simply refer to the document and say, “I’ll be glad to do this for you, but we’ll need to add this to the contract and re-total up the price.” Clients changing what they want done is okay–it’s just that you need to be compensated for extra time and effort investment.

5. Paid by the hour or by the project? I think it depends on the situation.

There’s a big debate in the web design world about whether you should be paid according to the number of hours you’ve worked on a project, or whether you should be paid according to the size of the project you did. I thought that I was solidly on the side of “by the project,” until I started trying to price services myself. Now, I think it depends on the type of work you’re doing.

For One-Time-Only Projects, Get Paid by the Project

If you’re doing a one-time-only design/development project–say, if a client wants a layout and coding to go with it–then I’d likely choose to get paid by the project. Since you’re not going to be doing ongoing maintenance, and assuming you’re going to complete the work in as quick a time as possible, asking for payment based on the number of images you made and the pages of code you created seems to be a better fit than asking to be paid based on hours you worked.

For Ongoing Projects, Get Paid by the Hour

However, for continuous maintenance job on a website, I’d personally get paid by the hour. Since you’re likely doing daily to weekly maintenance, you need to be compensated for that time you spend each day or each week. It’s not really a “project” in and of itself–it’s keeping up the quality of the project by checking in on it and making sure things are still current.

This is, however, a personal decision that each web designer has to make for himself or herself. These are simply my reasons for choosing which type of payment style works best for me.

Summary

If you want to do web design/development as a career, you need to consider methods of payment, client relations, type of work done, and contracts. This all goes into how you want to price your design services. I hope this article has helped jump-start your own thinking, and given you some food for thought!

A Jungle of Strange Words: My Forays into PHP and MySQL

ajungleofstrangewords

My current experience with PHP and MySQL has not been all tiptoeing through tulips. More often, it’s slashing my way through somebody else’s jungle-y code, trying desperately to understand how each part of the code functions, why even the smallest comma or space throws everything off, etc.

I’ve struggled with various projects in the last few years, mostly working on getting PHP to display results from a MySQL database. One of those projects is this very blog, which is now working beautifully after a few false starts. The other, a Magic: the Gathering trades database, never would find search results the way it was supposed to despite hours of debugging and reworking. (I finally got tired of struggling with it and screaming at it after about a YEAR–I was never so happy to hit the Delete button in my entire life.)

The Problem I Face (and What Most Newbie Programmers Face)

The bottom line is that PHP and MySQL are two of the more logic-based, technical Web programming languages out there. It has been far more difficult to teach myself PHP and MySQL than it was to teach myself HTML and CSS, because the vocabulary is so different, and the syntax is hard to read. From this newbie’s perspective, some of PHP and most of MySQL just hasn’t made sense at all; it’s just dollar signs and semicolons everywhere, and thus debugging it is a lost cause (as I discovered).

More experienced programmers might ask, “Well, why not just Google it and learn from tutorials?” There’s a problem with most tutorials available on the Internet; they are simply not written for actual programming newbies. They contain far too many technical words that are not easily defined–terms that someone with experience would know right away, but which a complete newb to programming would be confused by.

But Never Fear! Help Is On the Way!

Thankfully, after much, MUCH searching, I have discovered a few simpler, well-paced and fully-explained tutorials available to PHP and MySQL newbs like myself:

In some of these tutorials, I have found long-searched answers to some of the most basic MySQL and PHP questions I’ve had–questions which undermined any knowledge I tried to take in. With those now answered, I think I’m finally on my way to understanding. Check them out, and see if these careful explanations work for you!