 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Rob Allen's Blog: One-to-Many Joins with Zend_Db_Table_Select
by Chris Cornutt February 08, 2012 @ 09:28:20
Rob Allen has a tip for the Zend Framework users out there using the Zend_Db module to connect to their database resources - how to do a one to many join with the help of Zend_Db_Table_Select (easier than it sounds).
Let's say that you want to set up a one-to-many relationship between two tables: Artists and Albums because you've refactored my ZF1 tutorial. [...] Assuming you're using Zend_Db_Table, the easiest way is to turn off the integrity check and do a join in a mapper or table method.
He includes a few lines of source to illustrate, calling the "setIntegrityCheck" value to "false" to tell ZF not to worry about the additional join value over to the artists table. The result is a new column value with the artist's name instead of just the ID.
voice your opinion now!
onetomany database table join zendframework zenddb component
Gonzalo Ayuso's Blog: How to protect from SQL Injection with PHP
by Chris Cornutt February 08, 2012 @ 08:07:05
In a recent post to his blog, Gonzalo Ayuso shares a few tips on preventing SQL injection attacks on your applications.
Security is a part of our work as developers. We need to ensure our applications against malicious attacks. SQL Injection is one of the most common possible attacks. Basically SQL Injection is one kind of attack that happens when someone injects SQL statements in our application. You can find a lot of info about SQL Injection attack. Basically you need to follow the security golden rule: "Filter input, Escape output".
He advocates the use of the PDO abstraction layer to filter out a lot of the issues. Using its prepared statements, you can easily strip out things that just adding slashes to user input wouldn't prevent. He also includes a reminder about database permissions - allowing only certain users the ability to, for example, delete can help provide one more level of security (in other words, don't use a "super user" in production).
voice your opinion now!
sql injection pdo protect database permissions tutorial
Brian Swan's Blog: Using SQL Azure Federations via PHP
by Chris Cornutt January 20, 2012 @ 08:31:46
Brian Swan has a new post to his blog about using Azure Federations in your PHP applications:
In a nutshell, SQL Azure Federations introduces an abstraction layer for the sharding of SQL Azure databases. The value in federations lies in your ability to have elastic scalability of the database layer of your application (to match the elastic scalability of the rest of your application when it's running in the cloud). And, one nice thing about the way federations work is that nearly everything can be done with simple SQL commands. Of course, that means that using SQL Azure Federations via PHP should be easy. So in this post, I'll introduce you to SQL Azure federations by showing you how to use them via PHP.
He uses the SQL Server drivers to make the connection to the Azure instance and, based on his included code, creates a federation and tables inside it.
He also shows how to insert data into these tables, split up a federation, insert data after this split and how to query a federation member with the filtering on or off.
voice your opinion now!
azure federation tutorial windows sharding database
Developer Drive: Building a PHP Ad Tracker Creating the Database Tables
by Chris Cornutt January 16, 2012 @ 12:48:30
On Developer Drive today there's a new post (the first in a series) from Gerald Hanks about building an ad tracker in PHP. In this first part he sets up some of the background - the database that will hold the tracker information.
Banner ads for services related to the web site owner's industry allow customers to view products that tie into the site owner's core business. In exchange, the web site owner can charge the banner ad owner for every impression (banner ad appearance) or click-through (when a user clicks the banner ad). In order to build a banner ad management system, we must first create the database tables that will hold the ad information, the client data and the activity schedule for each ad.
He includes the SQL you'll need to create a few tables - the tracking table for the ads themselves (their metadata), the clients table to handle the groups wanting the ads and the activity table to track views and click-throughs.
voice your opinion now!
ad tracker database table tutorial clickthrough
PHPMaster.com: Writing Custom Session Handlers
by Chris Cornutt December 29, 2011 @ 09:41:25
On PHPMaster.com today there's a new post showing you how to write custom session handlers - in their case, a database-based option that can span across multiple servers/services.
Sessions are a tool which helps the web programmer overcome the stateless nature of the internet. You can use them to build shopping carts, monitor visits to a website, and even track how a user navigates through your application. PHP's default session handling behavior can provide all you need in most cases, but there may be times when you want to expand the functionality and store session data differently. This article will show you how the default functionality works and then goes on to show you how override it to provide a custom solution.
They introduce how sessions are stored normally (based on the save path) and what the serialized contents of it would look like. They show you how to take this, normally stored on the local file system, and change it to be written to a "session" table in a MySQL database (via PDO). It includes reading, writing, updating and some garbage collection to clean out old values from the table.
voice your opinion now!
custom session handler tutorial mysql database pdo
Smashing Magazine: Create A Christmas Wish List With PHP (For Beginners)
by Chris Cornutt December 23, 2011 @ 10:23:51
In this new tutorial Smashing Magazine shows you how to create a mini "Christmas List" application with PHP, HTML and CSS (and a little bit of database help) to display a list of what you or your family wants this holiday.
'Tis the season to be jolly, and how much jollier could we make it than with a helpful Christmas wish list crafted for your family to ensure that you get maximum presentage this holiday? In this article, we will focus on creating a very simple system that allows you to add gift ideas to a Web page, and for your family (or whoever) to view the list.
They walk you through the setup of the basic PHP file structure, the HTML template for the list output, CSS to make it look nice and the actual PHP backend - working with a MySQL database to pull out product information and use a simple login method.
voice your opinion now!
christmas list tutorial html css database beginner
DevArticles.com: Singletons in PHP
by Chris Cornutt December 06, 2011 @ 10:17:33
On DevArticles.com today there's a new tutorial posted talking about one of the more popular design patterns, the Singleton, and how it can be implemented in PHP.
Though in the past they enjoyed both popularity and a certain amount of prestige, without a doubt Singletons have progressively become one of the most evil and despicable villains in object-oriented design. Singletons earned their bad reputation for a reason: bringing them to life requires the programmer to deal at least with a static method. This is simply an elegant masquerade for creating a global access point (which in most cases is mutable as well) throughout an entire application. And we all know that global, mutable access is unquestionably a bad thing that must be avoided at all costs.
In this first part (of two) of the series they introduce the Singleton pattern and show how, via an example of using a database adapter interface to work with a MySQL database, in a tightly coupled example.
In the second part of the series, they'll show how to break these apart using dependency injection.
voice your opinion now!
singleton designpattern dependencyinjection di mysql database adapter interface
Developer Drive: PHP User Survey Setting Variable Values and Reading from Tables
by Chris Cornutt November 30, 2011 @ 11:04:33
The Developer Drive blog has the latest post in their "PHP User Survey" series focusing on setting up admin functionality for the poll managers to use.
In Part I of this series, we started the process of creating user polls for a business web site. Part I gave the layout of the data layer and began the construction of the class file. In this part we will continue with adding methods to the class file that will enable the administrator to set the variable values and read from the database tables.
Code is included for setting the poll and answer ID values (setters), grabbing the number of polls currently defined, finding the active ones and pulling out poll data along with its answers. If you need to catch up, you can find the other parts here: part one, part two.
voice your opinion now!
survey poll tutorial database table
|
Community Events
Don't see your event here? Let us know!
|