|
<?php
require_once 'config.php'; $dbConn = mysql_connect ($dbHost, $dbUser, $dbPass) or die ('MySQL connect
failed. ' . mysql_error()); function dbQuery($sql) function dbAffectedRows() function dbFetchArray($result, $resultType = MYSQL_NUM) function dbFetchAssoc($result) function dbFetchRow($result) function dbFreeResult($result) function dbNumRows($result) function dbSelect($dbName)
How to use it ?Below you can see an example on how to use this database abstration library. The first one is using PHP database function directly : <?php
require_once 'config.php'; $conn = mysql_connect($dbHost, $dbUser, $dbPass); $sql = "SELECT * $result = mysql_query($sql); $products = array(); And the second one is using our database abstraction. We don't have to initiate the connection this time because it is done from database.php : <?php
require_once 'config.php'; require_once 'database.php'; $sql = "SELECT * $result = dbQuery($sql); $products = array(); As you can see, using database abstraction isn't so hard at all. Now that we have taken care the database issues we start building the admin pages. |
| Check for TNX review | need any life and critical illness cover then let us help | Searching for online sweepstakes ? Check out WinPrizesOnline | |
|
|
Database Design | PHP MySQL Shopping Cart Tutorial : Database Abstraction | Admin Control Panel |
|
At long last i'm finally able to update this site. Now the shopping cart can handle payment through paypal. As always you have any critiques, questions, comments or problems about this tutorial please tell me. Click here to send your feedback. And if you like this tutorial please link to this site. It will really help a lot :-) |
PHP MySQL Shopping Cart Tutorial
Copyright © 2005 - 2010 www.phpwebcommerce.com