News Feed
Jobs Feed
Sections




Recent Jobs

News Archive
feed this:

NETTUTS.com:
How to Create a PHP/MySQL Powered Forum from Scratch
March 18, 2010 @ 11:21:46

On NETTUTS.com there's a (quite complete) tutorial posted that walks you through the creation of a forum using PHP and MySQL as a backend to store the posts.

In this tutorial, we're going to build a PHP/MySQL powered forum from scratch. This tutorial is perfect for getting used to basic PHP and database usage.

They start with the backend and move their way forward, setting up the MySQL tables - categories, replies, users and topics. They describe each of them in a bit more detail before getting into the code. They show how to create template for the site (with a little CSS) and include code to create users, authenticate them, set up their permission levels, making categories/topics and much more.

The full code for the forum application they've created can be downloaded here.

0 comments voice your opinion now!
mysql tutorial forum beginner



Jeremy Cook's Blog:
Handling Binary Data with PDO
March 03, 2010 @ 14:48:56

Jeremy Cook has put together a quick guide for something that can be tricky when using PDO in PHP - handling binary data in the return from your queries.

I like the fact that if I needed to use MS SQL Server, Oracle or any of the other big RDBMS's I could use the same PDO syntax to access them rather than learning a new database access library. However, there do seem to be some bugs in PDO according to what I've read on the web. While I haven't encountered most of them and can't comment on them I'd like to write about one that I ran into the other day and how I worked around it.

He was storing images in the database and pushing the information into the database was working fine. When he tried to pull the contents back out, however, the information wasn't being handled correctly (according to the example in the PHP manual) because of a differing return value for the fetch call - sometimes it's a string but, in this case, it's binary data so it needs to just be passed on through.

0 comments voice your opinion now!
pdo database mysql binary data


Lullabot.com:
Single Sign-on across Sub-Domains in Drupal with No Extra Modules
March 03, 2010 @ 11:06:57

On the Lullabot.com blog there's a recent post from Nate Haug showing how you can set up a single sign on with Drupal even if your user crosses multiple sub-domains on your site. The technique is particularly handy in that it doesn't require any extra modules to be installed to make it work.

With the multitude of single sign-on modules out there for Drupal, it's easy to miss the fact that Drupal has a built-in single sign on mechanism already. No modules, no configuration, just 20 easy lines of PHP in your site's settings.php file. This solution works for a lot of clients, but the set of requirements is pretty specific as to when you can use this approach.

To make it work all sites must be on the same domain (just sub-domains of it), be using MySQL as your backend database and, if you're using clustered hardware, they need to be on the same cluster to be able to make the cross-database queries. Since Drupal can prefix tables so the settings for each site are split out, you can create a "shared table" by making a few changes in your master and slave configuration.

0 comments voice your opinion now!
single signon drupal tutorial mysql authentication


Internet.com:
Plotting Map Markers Dynamically Using the Google Maps API, jQuery, PHP, and MySQL
February 18, 2010 @ 09:44:25

On Internet.com there's a new video tutorial showing you how to work with the Google Maps API and PHP to create a Google map with multiple points plotted from the coordinate data held in a MySQL database. The example doesn't use any sort of framework to get the job done - just straight PHP.

The Google Maps API makes it trivially easy for anybody to create a custom Web-based map, complete with features such as event handlers, route directions, and sophisticated overlays. However, the genesis of many such features stems from your ability to easily add map markers and store the corresponding coordinates within a database such as MySQL.

Unfortunately, there's no link to the sample code, so you'll just have to follow along on-screen. He does make it easy to tie the three technologies together - PHP, MySQL and jQuery - and make a simple multi-point map system. It's flexible too and can be easily extended to include more information in each of the map points (like a name for the location).

0 comments voice your opinion now!
mysql jquery tutorial googlemaps plot


HotToForge.com:
Installing Cherokee With PHP5 And MySQL Support On Ubuntu 9.10
February 17, 2010 @ 10:08:02

On the HowToForge.com site there's a new tutorial showing you how to get Cherokee, PHP and MySQL working on Ubuntu. Chreokee is a light-weight web server that has no dependencies beyond the standard C libraries.

Cherokee is a very fast, flexible and easy to configure Web Server. It supports the widespread technologies nowadays: FastCGI, SCGI, PHP, CGI, TLS and SSL encrypted connections, virtual hosts, authentication, on the fly encoding, load balancing, Apache compatible log files, and much more. This tutorial shows how you can install Cherokee on an Ubuntu 9.10 server with PHP5 support (through FastCGI) and MySQL support.

They use the aptitude package manager to install all of the software needed - the MySQL server and client, Cherokee and PHP - and include some of the configuration options you'll need to change to get it all up and running. The PHP functionality is provided to the web server via the FastCGI installation. A few screenshots are thrown in to show the Cherokee web-based admin interface in action.

0 comments voice your opinion now!
cherokee webserver install mysql ubuntu tutorial


Giulio Pons' Blog:
PHP to get enum/set values from mysql field
January 21, 2010 @ 11:14:26

Giulio Pons has a quick post with a code snippet showing how to grab the possible values for an ENUM or SET field on a MySQL database.

This function returns an array with the elements allowed in a ENUM or SET mysql field. This can be usefull if you're making some automation and need to retrieve those values without writing them in your code.

The function uses the database's metadata to get the column information for a table and filter out the "enum" information from that. The column information includes the set of values possible and a few simple string handling functions make it easy to grab them. They could also be replaced by a regular expression or two to grab the same information more concisely.

0 comments voice your opinion now!
enum mysql allowed values


PHPBuilder.com:
Build a PHP Link Scraper with cURL
January 15, 2010 @ 10:02:45

On PHPBuilder.com today there's a new tutorial posted about building a link scraping script with the combination of PHP and cURL (the script pulls in a page, grabs all of the links off of it and follows them, etc).

I actually built this a few years ago because I had grandiose visions of becoming the next Google. Clearly, that did not happen, mostly because my localhost, database, and bandwidth are not infinite. Yet this little robot has quite interesting applications and uses if you really have the time to play with and fine-tune it.

You'll need to have cURL support built into your PHP installation to get the scripts working, but the actual code itself is pretty simple. Curl and XPath do most of the heavy lifting of finding and following the links and its easy enough to drop them into a MySQL table from there. You can download the source here.

0 comments voice your opinion now!
link scraper curl xpath mysql tutorial


Blue Parabola Blog:
Getting Started with Zend_Test
January 12, 2010 @ 14:12:41

On the Blue Parabola blog today there's a look at working with the Zend_Test component of the Zend Framework (from Matthew Turland).

I went to the "tests" directory generated for me by the zf CLI utility to get started. What I found there was three files: application/bootstrap.php, library/bootstrap.php, phpunit.xml They were all completely empty, which didn't really provide much in the way of guidance on how to get started. The Zend_Test documentation is good, but was a bit lacking in that area as well; it really only covers how Zend_Test extends the capabilities of PHPUnit.

Matthew walks you through his process of creating a sample PHPUnit XML configuration file (with a little help), updating your bootstrap to load in paths to the test files and the creation of a sample test case for a MySQL database. He runs a test on the database to compare it to a standardized data set based on an XML file (seed.xml). He also looks briefly at testing controllers, some sample code included for this as well.

0 comments voice your opinion now!
zendtest unittest phpunit mysql zendframework


HowToForge.com:
Installing Lighttpd With PHP5 And MySQL Support On OpenSUSE 11.1
January 07, 2010 @ 11:44:01

On HowToForge.com there's a new tutorial on how to get the combination of Lighttpd, PHP and MySQL up and running on an OpenSuse linux installation.

Lighttpd is a secure, fast, standards-compliant web server designed for speed-critical environments. This tutorial shows how you can install Lighttpd on an OpenSUSE 11.1 server with PHP5 support (through FastCGI) and MySQL support.

Most of the software installation is handled via packages installed by the "yast2" package manager but you'll still need to go in and modify some of the configuration files to get PHP and Lighttpd to play nicely together. Besides the MySQL package required for PHP's MySQL support, they also suggest getting a few other packages for things like SOAP, SQLite, IMAP, zlib and openssl.

0 comments voice your opinion now!
tutorial opensuse lighttpd mysql yast2 package


Matthew Turland's Blog:
Database Testing with PHPUnit and MySQL
January 05, 2010 @ 13:24:49

In a new post to his blog Matthew Turland looks at a contribution he recently made to the PHPunit project to help it support database testing without the need for dumping the contents of your database out to a CSV.

If you're using MySQL as your database, CSV has been the only format supported by both the mysqldump utility and the PHPUnit Database extension up to this point. My contribution adds support for its XML format to the extension. While this support was developed to work in the PHPUnit 3.4.x branch, it won't be available in a stable release until 3.5.0. In the meantime, this is how you can use it now.

There's four steps you'll need to do to get it installed - grab the latest from github, create the seed data XML file, make a test case extending PHPUnit_Extensions_Database_TestCase and run your tests against the database information.

0 comments voice your opinion now!
phpunit database testing mysql unittest



Community Events









Don't see your event here?
Let us know!


conference sqlserver symfony performance microsoft hiphop opinion wordpress zend podcast zendframework feature release job framework facebook extension codeigniter developer windows

All content copyright, 2010 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework