PHP dan MySQL, seolah pasangan sejati yang tak terpisahkan. Keduanya paling sering disandingkan dalam pembuatan aplikasi berbasis web (web application development). Tak heran jika begitu banyak fungsi terkait dengan MySQL yang disediakan oleh PHP. Setidaknya terdapat 45 fungsi PHP terkait dengan MySQL mulai dari koneksi, pengambilan data, query data hingga informasi server MySQL.
Dalam tutorial ini akan dikenalkan berbagai fungsi PHP terkait dengan pengambilan data MySQL. Pengambilan data yang dimaksud disini tepatnya adalah pengolahan hasil perintah query SELECT yang dihasilkan dari fungsi mysql_query(). Hasil perintah query dapat diolah untuk ditampilkan atau diproses oleh PHP melalui berbagai fungsi yang diawali dengan mysql_fetch_*. Terkait hal tersebut, PHP memiliki 6 (enam) fungsi yaitu: mysql_fetch_array(), mysql_fetch_assoc(), mysql_fetch_field(), mysql_fetch_lengths(), mysql_fetch_object() dan mysql_fetch_row().
Dalam tutorial ini akan dijelaskan kegunaan dari 4 (empat) fungsi yaitu mysql_fetch_array(), mysql_fetch_assoc(), mysql_fetch_object() dan mysql_fetch_row(). Sementara dua fungsi lainnya yaitu mysql_fetch_field() dan mysql_fetch_lengths() tidak dijelaskan di tutorial ini karena keduanya tidak terlalu berkaitan dengan pengambilan data MySQL, selain itu keduanya akan dihilangkan setelah PHP versi 5.5.0.
Today, we have a beautiful Christmas icon freebie for you created by the talented, hard-working folks at RocketTheme. The icon set contains ten icons available as 256×256px PNGs that have been lovingly and exclusively prepared for Smashing Magazine and the Web design community. As usual, the set is released under a Creative Commons license and can be used in commercial and private projects.
Yes, our brand new Smashing Mobile Book has finally arrived, and it has almost reached your doorstep! If you’ve already pre-ordered the book weeks ago, then it’s really only a matter of days! Until then, the complimentary digital version is waiting for you in your Smashing Shop dashboard. And if you haven’t ordered just yet, make sure to get the book now!
At this very moment, all pre-orders are being shipped from Berlin, Germany, by airmail. Due to an unexpected huge amount of pre-orders in the past days, delivery of the new book orders will take a bit longer since we only have a limited amount of printed books in pre-sale stock.
Of course, we are printing extra copies in this very moment as you read this post. But unfortunately, the shipping of the new printed copies can only start in early January 2013. Still, you get the eBook automatically once you’ve ordered the printed book, so you can start reading right away!
eBook Is Now Available
The eBook of the Mobile Book is available for download immediately: PDF, ePUB and Kindle formats for your convenience. If you have pre-ordered the book, your eBook is waiting for you in your Download Area. Also, keep in mind that the eBook is included in the Smashing eBook Library—our annual subscription with 70% discount on all Smashing eBooks.
And if you still haven’t ordered yet, you can get the Mobile book right now, and start reading within a couple of minutes! You won’t be disappointed. Why? Let’s see why.
About the Book
Our brand new printed Mobile Book features the most important things that you need to know as a designer, developer or mobile strategist to make your websites optimized for mobile. You’ll dive deep into the peculiarities of the mobile industry, explore responsive design strategy, design patterns and optimization techniques, learn about wireframing and prototyping for mobile as well as the guidelines for designing with gestures and touch. If you are looking for a good book on mobile, this is the one.
Table of Contents
When setting up the concept of the book, we worked hard to ensure a delicate balance between advanced knowledge and the current state of the art:
Jeremy Keith has been around on the Web for a while and saw the emerging mobile medium from its earliest days. With his preface for the Mobile Book, Jeremy introduces us to this new facet of the Web and the new possibilities and challenges that the Mobile industry produces as a relatively young medium.
What’s Going on in Mobile?
This chapter provides a general overview of what’s going in the mobile industry today, who are its main players and how they influence each other. From a technical perspective, the chapter reviews the peculiarities of mobile networks and platforms, existing mobile browsers and guidelines for testing websites on mobile. You’ll understand the mobile market, how it works, what it involves and how it affects our daily work.
Chapter keywords:mobile value chain, operators, device vendors, fragmentation, Android, iPhone, Windows Phone, OS vendors, proxy browsers, open device lab, mobile network.
The Future of Mobile
This chapter provides a glimpse of where the future of mobile might lead, and what technologies will lead us there. These include new low-power computer chips, new display technologies, new APIs and the growing penetration of near field communication (NFC). But more important than the technologies themselves is how they will need to work together, enabling new and exciting ways to do business, to connect with friends and family and to interact with the world around us.
The main components of Responsive Web Design(RWD) — flexible grids, flexible images, and media queries — are just the tip of the iceberg. And with the ever-increasing number of devices flooding the market, RWD is the most effective way to address them all at once. This chapter by Trent Walton features strategies, techniques and design workflow tips on building effective and bulletproof responsive designs.
Chapter keywords:image aspect ratios, resolution independence, breakpoints organization, vertical and em-based media queries, content choreography, image hierarchy, fluid type.
Responsive Design Patterns
As Responsive Design continues to evolve, we’re confronted with difficult problems about how to create adaptive interfaces that look and function beautifully across many screen sizes and environments. E.g. how do we handle navigation that’s four levels deep? This chapter features emerging responsive design patterns and explains how to use them meaningfully in your projects. Brad Frost provides useful tips and expert advice on various design elements covering everything from complex navigation to advanced data tables.
Although Responsive design per se has provided a great fundamental concept for designing mobile-optimized websites, the core ideas that make up these concepts pre-date the mobile revolution. In this chapter, Dave Olsen reviews what it takes to optimize mobile experiences in terms of performance. How do we keep responsive websites lightweight? What do we need to know about caching, lazy loading, latency? How can we start using RESS? Device detection or feature detection? Also, how do we develop and test our websites for performance? This chapter answers all these questions and more.
Chapter keywords:mobile performance, latency, localStorage, lazy loading, Data URI scheme, JS frameworks, RESS, browser detection, feature detection.
Hands On Design for Mobile (UX Perspective)
Mobile requires us to rethink the way we create, develop and build experiences for our users. In this chapter, you’ll look at some of the more glaring pitfalls to conventional processes, specifically as they pertain to how we design—and how we communicate design—for an increasingly mobile-accessed Web. You’ll learn about implementing and selling processes that support a realistic understanding of what it means to design with mobile in mind.
Among the many new opportunities of the mobile medium are the capabilities of mobile devices. One of the major interaction changes, however, involves gestures and touch. In this chapter, Josh Clark explains how we can use them to improve the mobile user experience and provides concrete examples of implementations in real-life applications.
To ensure the quality of the book’s content, the chapters have been reviewed by a number of active members of the mobile design community such as Scott Jenson, Bruce Lawson, Lyza Danger Gardner and Bryan Rieger—just to name a few. It wasn’t easy to bring together such a stellar line-up of experts, but a compromise wasn’t an option.
Initially, we wanted to cover all popular mobile topics within the printed book, but because some chapters took more time to write and review than planned, we decided to release them in an addendum to the printed book. All buyers of the Mobile Book will get the Addendum for free in January 2013. The eBook will provide insights into design and development for iOS, Android, Windows Phone, as well as introduce developing and debugging techniques for advanced HTML5 Web applications and explore UX patterns on these platforms.
A few reviewers have had the chance to read the book a few days before its release, and share their views in a non-committal way. The result is very clear: the book is worthwhile. Should you get it? Yes! Let’s see why:
“I got my hands on an early copy of The Mobile Book, by Smashing Magazine. I’ll cut to the chase and just say this: It’s fantastic. You should own it. Really.”
“The standard, the reference book for Mobile. I worked for a mobile web publishing company for 18 months and the depth of knowledge provided by the experts in this book is extraordinary. It blew me away. This book provides a diplomatic, comprehensive guide to understanding “Mobile”, delivered by people who have a real passion for the Mobile endeavours in our community.”
“I’ll cut to the chase for those deliberating a purchase: it’s well worth the cover price. The eBook edition is a steal! This book establishes a mindset of understanding and exploring the medium. It embraces the breadth of its domain and will set you on an exciting path.”
“As somebody who spends a lot of time tinkering and tweaking websites to make them work better, I thought this book was bloody brilliant. There is so much depth and information packed into its 336 pages that I think it will become the book for the mobile Web.”
“It’s essential reading for those involved with the design and development of web/app based output. The essays within will encourage you to consider how people interact with mobile technology and help you to produce mobile friendly solutions to your projects.”
“This book has something for all levels of expertise. [..] It doesn’t patronise, it doesn’t talk over your head either, it teaches. It is an important book of its time, don’t hesitate in picking it up.”
“In general I think this book is a great addition for a company or agency library. As a specialist, it can leave you with a few chapters that are very much beyond your reach and can leave you with dangerous “knowledge” but a team reading the applicable chapters and then pooling their knowledge and learnings can use this book to go into the mobile future kicking and screaming. And kicking arse.”
We want to make it as easy as possible for everyone to buy the new Smashing book. We welcome all suggestions and advice that could improve Smashing Magazine’s user-friendliness. Here are answers to some frequently asked questions about the brand new Smashing Mobile Book:
What are the costs for shipping to my country?
The shipping cost for one book or a bundle is $5 — wherever you are in the world. We ship everywhere worldwide. We are paying a share of the shipping costs ourselves to make it possible for anyone to purchase the book. Our prices are transparent: we don’t have any hidden costs, and we won’t confuse you with tricky calculations. What you see is what you pay!
What about delivery times?
All books will be shipped via air mail to keep delivery times as short as possible. You can find the anticipated delivery time for your country in the delivery times overview. Please note that we will start to ship the books early-mid December 2012.
Will the book be available in other languages?
Maybe in future, but we have not made arrangements for that yet, so don’t hold your breath.
No, “The Mobile Book” is a new series that we are starting here at Smashing Magazine. It is not Smashing Book #4 — it has a different design, layout and concept than other Smashing books. However, the Smashing Book #4 will be published in May 2013 — please stay tuned!
What payment methods are accepted?
We accept PayPal, VISA, MasterCard and American Express. We use a secure connection, with 256-bit AES encryption and a green GeoTrust Extended Validation SSL CA certificate.
Is there a money-back guarantee?
Yes, absolutely! No risk is involved. Our 100-day full money-back guarantee keeps you safe. Don’t hesitate to return your purchase. You’ll get your money back—no ifs, ands or buts about it.
We would appreciate it if you could inform your friends, colleagues and followers about the book. Feel free to link to www.the-mobile-book.com, this post and use the hashtag #mobilebook on Twitter. If you choose to blog about the book, please feel free to use the images and information from our Mobile Book media kit (.ZIP, 6.6 Mb) which includes screenshots, photos and general information about the book.
Thank you for your support, everybody—we truly appreciate it. And we hope that you’ll love the Mobile Book just as much as we do!
Do you own a website? Do you want to be number one on Google? Whatever you do, don’t spend money on aggressive search engine optimization (SEO). I know that sounds like an extreme position to take. However, a lot of website owners see search engine optimization as the answer to their search ranking woes, when things are considerably more complex.
The inconvenient truth is that the best person to improve your ranking is you. Unfortunately, that is going to take time and commitment on your part. The answer doesn’t lie in hiring a SEO company to boost your website ranking for Google. The problem starts with the term “search engine optimization” and the misconceptions surrounding it.
What SEO Isn’t
Most website owners perceive SEO as a dark art, shrouded in mystery. They have heard phrases like “gateway pages” and “keyword density”, or have been bamboozled by technobabble about the way websites should be built. All of this has left them feeling that SEO is the purview of experts. This is a misconception reinforced by certain segments of the SEO community.
The problem is that these kinds of complex techniques do work, to a point. It is possible to improve placement through a manipulation of the system. However, although it can have short term benefits, it will not last without continual investment. This is because the objective is wrong. SEO shouldn’t be about getting to the top of Google for particular phrases. In fact, we shouldn’t be optimizing for search engines at all. We should be optimizing for people. After all, that is what Google is trying to do.
Why You Shouldn’t Be Optimizing For Search Engines
Google’s aim is simple: connect its searchers with the most relevant content. If you are more worried about a good ranking than providing relevant content, then you are going to be fighting a losing battle.
If you hire a SEO company to improve your placement and you measure their worth on the basis of how high they get you in the rankings, then you are out of line with what Google is trying to achieve. Your primary objective should be better content, not higher rankings.
The SEO company can use every trick in the book to get you better rankings, but over the long term they will lose, because Google is constantly changing how it rates websites so it can provide more accurate results.
Remember, you shouldn’t be optimizing for ranking in search engines, you should be optimizing for users.
A Better Way
Google does not make a secret of how to gain a high ranking. It states clearly in its webmaster guidelines:
“Make pages primarily for users, not for search engines.”
So how do you actually do that? Again Google provides the answer:
“Create a useful, information-rich website, and write pages that clearly and accurately describe your content.”
In short, write useful content. This could include (but is not limited to):
Publishing white papers,
Writing a blog,
Sharing research findings,
Producing detailed case studies,
Encouraging user-generated content,
Creating useful applications or tools,
Running a Q&A section,
The list could go on. The key is to produce content people find useful and want to share.
Yes, there are some technical considerations when it comes to search engines. However, any reasonably well-built website will be accessible to Google. You don’t need an expert SEO company for that (at least not if the Web designer does their job right).
As an aside, it is worth noting that if you take accessibility seriously for users with disabilities (such as those with visual impairments), then you will also make a website accessible to Google.
However, setting those technical issues aside, it all comes down to content. If you create great content, people will link to it, and Google will improve your placement. It really is that simple.
The question then becomes, how do you create great content?
The Inconvenient Truth
This is the point where we come to the inconvenient truth. It is hard for an outside contractor to produce the great content that will keep users coming back and encourage them to share. In my experience, this is much better done internally within the organization. The problem is that this doesn’t sit well with most organizations. Its easier to outsource the problem to a SEO company than to tackle an unfamiliar area internally.
Admittedly, a good SEO company will have copywriters on board who can write content for you. However, their knowledge will be limited, as will their ability to really get to know your business. Yes, they can write a few keyword-heavy blog posts that Google will like the look of. However, this won’t fool users, and so the number of links to that content will be low.
The truth is that if you are serious about improving your placement on search engines, it has to be done internally.
This truth is all the more painful, as most organizations are not configured to do this properly.
Organizational Change Required
The more I work with organizations on their digital strategy, the more I realize how few are structured to do business in a digital world. The issue of SEO is an ideal example of the problem.
Responsibility for the website normally lies with the marketing department. Although marketing is well-experienced in producing and writing marketing copy that outlines the products and services the organization provides, they are not best equipped to write content that will be heavily linked to.
It is not surprising that if you search on a term like “call to action,” the top results are almost exclusively informational articles, rather than companies helping with services in this area.
The problem is that marketeers are experts in the product or service being sold, not necessarily the surrounding subject matter. For example, the marketing department of a company selling healthy meals will know everything about the benefits of their product, but will have a limited knowledge of nutrition. Unfortunately, people are more likely to link to a post on healthy eating tips than they are to link to some marketing copy on a particular health product.
What you really need is the nutritional expert who designed the meal to be posting regularly to a blog, talking about what makes a healthy diet. A blog like this would include lots of linkable content, would be able to build a regular readership and would produce keyword-rich copy.
The problem is that this is not how organizations are set up. It is not the nutritional expert’s job to write blog posts; that responsibility belongs in marketing.
The Long-Term Solution
Ultimately organizations need to change so that online marketing is a more distributed role with everybody taking responsibility for aspects of it. I am not suggesting that the central marketing function has no role in digital, but rather recognizing that they cannot do it alone. Others will need to have some marketing responsibilities as part of their role.
For example a company selling healthy meals should allocate one afternoon each week for their nutritional experts and chefs to share their expertise online. It would become the marketing department’s responsibility to support these bloggers by providing training, editorial support and technical advice.
Unfortunately, these experts are often the most valuable resource within a business, and so their time is incredibly valuable. The idea of “distracting” them from their core role is too much for many companies to swallow.
However, in the short term there is still much that can be done.
A Short-Term Solution
As we wait for companies to wake up and change the way they are organized, there are ways of working within the system.
If you haven’t already, consider hiring an employee dedicated to creating content for your website. You can partially finance it with the money you save by getting rid of your SEO company.
If that is beyond your budget, consider hiring a short-term contractor or a part-time staff member. You could even use an existing member of your staff as long as they have time set aside to prevent the Web being pushed down the priority list. Although this person won’t have the knowledge to write all the content themselves, by being situated inside of the business it will be much easier for them to get access to those within the organization who do.
Arrange meetings with these experts and talk to them about their role. Identify various subjects based on their knowledge and then either record a video interview or write up a blog post based on what they share. Also ask these experts what news sources they read or which people within the industry they follow. Monitor these sources and ask your expert to comment on what is shared. These comments can be turned into posts that add to the wealth of content on your website.
Finally, you may find that the experts within the business are already producing a wealth of content that can act as source material for content that users will find interesting.
For example, our fictional nutritional expert probably already has documentation on the health benefits of certain food types or how certain conditions can be helped through healthy eating. Admittedly this kind of material might be too dry or academic, but with some editing and rewriting it would probably make great online content.
The content you post does not have to be long, it just has to be link-worthy. The key is to share the opinion of your expert and provide content of value to your audience.
As that audience grows, start asking questions. Maybe even get some of your readers to share their experiences or knowledge. Over time you will discover that not only will your readers want to contribute, so will your experts. As they see the value in posting content regularly to the website, they will start blogging themselves. All you will have to do is suggest topics and edit their output.
I know what you are thinking: it just isn’t that simple.
No More Excuses
I realize this is a big cultural shift for many organizations. Marketing teams will feel they are losing control, the person responsible for blogging will feel out of their depth and the experts may resent being asked lots of questions. However, what is the alternative?
For better or worse, Google demands good content in return for high rankings. Pretending that SEO companies can magically find a shortcut that allows you to avoid this tradeoff just isn’t going to cut it.
If you care about how you rank, it is time to take responsibility for your website’s content. Once you overcome the initial hurdle, you will find that producing quality content on an ongoing basis becomes second nature.
After a heated discussion in comments to this article, in social channels and via Skype, Paul clarified his position in the article How I See The Role of SEO in his blog. We are republishing the article for the sake of making his arguments clear and unambiguous — of course, with Paul’s permission.—Ed.
There seems to be the perception that I want to see an end to the SEO sector. Although I have issues with the name, I do believe they have a role.
My message can be boiled down to the following points:
Website owners are unhealthily obsessed with their rankings on Google.
We should be creating primarily for people and not search engines.
The best way to improve your ranking is to produce great content that people link to.
That great content is better produced in-house, rather than being outsourced to an agency.
A good web designer can take you a long way in making your site accessible to search engines.
Before you spend money on an SEO company, make sure you have the basics in place first.
An unfortunate response
Unfortunately this caused a massive and aggressive reaction in the SEO community. Smashing Magazine was attacked for publishing the post, I was told I was out-of-date and ill informed (which is of course entirely possible), but worst of all there were a shocking number of attacks on me personally.
To be honest this doesn’t entirely surprise me. I have been working with the web long enough to be all too aware of the over reaction it creates in people. However, it is always hurtful when somebody attacks you as a human being, rather than your opinion.
Of course not everybody was like that. I had great conversations with Bill Slawski and Joost De Valk, both of who attempted to put me straight personally and on their blogs. I very much appreciate them taking the time and they have helped to soften my views.
SEO companies do have a role
I think it is important to stress that I do believe SEO companies have a role. The problem is they are often brought in when there is still much work that could be done internally within the organisation.
To me its about return on investment. Why spend money improving your search engine rankings when you could spend the same money improving rankings and producing more engaging content? Or why not spend money on improving your rankings and building a more accessible website?
There are two exceptions to that general rule of thumb.
First, the SEO industry is changing. They are increasingly helping clients with content and that is great. However, if that is the role they are going to take then they need to stop saying they are about “search engine optimisation.” Creating great content is not primarily an SEO job. They have a branding issue there.
Also, although I am happy for an SEO company to help educate clients about content they shouldn’t be writing copy for them week and week out for them. Take the approach of a content strategist who trains up the client, provides them a strategy and then encourages them to take on the role themselves. Isn’t that better for the client?
Cleaning up after bad web designers
The second exception is where the web designer has built an inaccessible website. As Joost De Valk said in his response to my post, it falls to the SEO company to clean up the mess.
This is obviously an issue that needs addressing in the web development community and why we need people like Joost speaking at web design conferences.
However, I wouldn’t expect a web developer to provide all of the technical subtleties of an SEO company. That is probably too specialist for most web designers to do.
I don’t doubt that these subtleties are important and do make a difference to rankings. However, once again it is important that we have the basics in place first:
A solidly built website.
Setting the right priorities
Hopefully that helps clarify my position slightly. I am not for a minute trying to destroy the SEO sector (as I was accused of repeatedly). What I am trying to do is set priorities straight.
I guess in short it is the phase “search engine optimisation” I have a problem with. It implies we should be accommodating the idiosyncrasies of search engines above the needs of users.
That is something I will never compromise over and I am sure something the vast majority of SEO companies would agree with.