PHP
  Home arrow PHP arrow Client Management for a PHP Invoicing System
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Client Management for a PHP Invoicing System
By: Leidago
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 14
    2006-09-20


    Table of Contents:
  • Client Management for a PHP Invoicing System
  • Building a table
  • Deleting clients and viewing their details
  • Updating client information
  • Adding a new client

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Client Management for a PHP Invoicing System
    ( Page 1 of 5 )

    What's an invoicing system that can't manage the data for the clients you're invoicing? This article, the third of four parts, shows how to make managing your clients easy. This part of the system allows you to view a full list of client names, and add, update or remove clients from your database.

    It is up to you how much information about clients you want to keep. As far as this article is concerned, I will only keep the information that is needed to run an invoice system. The obvious information to store about clients is name, address, email, phone number and of course the date that you started working with the client. You are very limited in what you can do with client information, in fact the few things you can do are add a new client, and remove, update, and view client data. 

    So let's create a table that will reflect this information:

    CREATE TABLE `client` (
      `id` int(4) unsigned zerofill NOT NULL auto_increment,
      `name` varchar(100) NOT NULL default '',
      `address` text NOT NULL,
      `date_added` date NOT NULL default '0000-00-00',
      `email` varchar(100) NOT NULL default '',
      `contact_name` varchar(100) NOT NULL default '',
      `phone_no` varchar(60) NOT NULL default '',
      PRIMARY KEY  (`id`)
    ) TYPE=MyISAM AUTO_INCREMENT=12 ;

    Simply copy and paste the above code into your MySQL clients' SQL window and run the SQL. Once the table has been created and it's all working, create a new PHP document and save it as "allclients.php." This page will list all the clients in the database. At the very top of the page, add the following code:

    Code7 allclients.php

    <?
    include "config.php";
    $query_clients = "SELECT * FROM client ORDER BY id DESC";
    $result_clients = mysql_query($query_clients);
    $num_clients = mysql_num_rows($result_clients);
    ?>

    The above code simply retrieves all the client data from the database. The retrieved number of rows is stored in the "$num_clients" variable.



     
     
    >>> More PHP Articles          >>> More By Leidago
     

       

    PHP ARTICLES

    - Using Directory Iterators to Build Loader Ap...
    - Using the spl_autoload() Functions to Build ...
    - Working Out of the Object Context to Build L...
    - Using the _autoload() Magic Function to Buil...
    - The Destruct Magic Function in PHP 5
    - The Autoload Magic Function in PHP 5
    - Developing a Recursive Loading Class for Loa...
    - The Sleep and Wakeup Magic Functions in PHP 5
    - Using the Clone Magic Function in PHP 5
    - Including Files Recursively with Loader Appl...
    - The Call Magic Function in PHP 5
    - Designing a Captcha System with PHP and MySQL
    - Using Static Methods to Build Loader Apps in...
    - The Isset and Unset Magic Functions in PHP 5
    - Advanced PHP Form Input Validation to Check ...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT