www.uburst.com www.uburst.com

"Interfacing uShop with MySQL"

Go back to the LobbyClick here to Go Back to Main ListingClick here to see helpClick here to Search the Forum

Database Ideas
Forum Type: Public
Moderator: edmunds
Time Zone: EST
Printer Friendly Format
Original Message
 
"Interfacing uShop with MySQL"
Posted by Microburst Support Team on Nov-02-01 at 09:00 PM (EST)
If you are tired of maintaining hundreds of product pages that contain uShop applets, you might consider putting your products in a database, and then dynamically generating your HTML pages containing uShop applets. If you know something about programming, you might be interested in getting familiar with PHP, an open-source language that can work with a MySQL database. Most web-hosting providers who support MySQL will have PHP installed as well for their customers to use freely. There is a good reference site at http://www.php.net to help you get started.

Depending on your programming skills, you could consider writing yourself some PHP code that reads your "producttable" and then dynamically populates product pages and your uShop applet options.

For example here is a loop written in PHP which connects to a MySQL database, accesses a "product table" looking only for products with a quantityavailable greater than zero, and then only prints out an applet for each of those products. You should notice that in this example I jump in and out of PHP with the symbols. FYI caution - this example does not include any error checking/handling:


// connect to your MySQL database
$db_socket = mysql_connect("yourhost.com","user","password");

// select only products which have a quantity
// available greater than 0 in your database
// (This assumes you have a table which is keeping
// track of your inventory, of course.)
$q = "select * from yourproducttable where qtyavailable > 0";
$qresult = mysql_db_query("yourdatabasename",$q,$db_socket);

while($row = mysql_fetch_object($qresult))
{

// here is a snippet of an applet, i left the
// rest of the applet out for brevity and made
// up some field names for this product table
?>







} // end while loop

?>

I am just suggesting one free solution, but there are no doubt other ways of interfacing a database with HTML pages containing uShop applets. I've also seen this done with ColdFusion and an Access database.

Christine Edmunds
Microburst Technologies Support Team

Click to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents

 Table of Contents

PHP MySQL Suggestion Works!, Brian Levine, Nov-02-01, (1)
PHP Sample Code, Microburst Technologies Support Team, Nov-14-01, (2)
Getting Started with PHP, Microburst Technologies Support Team, Nov-14-01, (3)
DB uShop with MySQL/Php ..., James - Hampton Development, Nov-19-01, (4)
msaccess example?, oliver, Mar-19-02, (5)
Integrating w/Access, Brian Levine, Mar-20-02, (6)
Integrating with access, oliver, Mar-20-02, (7)
ASP to Access, Brian Levine, Mar-22-02, (8)

 

 
Click here to goto Click here to goto the Lobby
Messages in this discussion
 
1 . "PHP MySQL Suggestion Works!"
Posted by Brian Levine on Nov-02-01 at 09:03 PM (EST)
Wow! This is fabulous! I keep all of the tag info for my catalog in one table, along with image path and size, and using just a few basic page templates, I only have to change the id data in the query for each item. If qty = 0 in the table then it displays the out of stock message instead of the item applet.
Not only will this help me to update my catalog a lot easier, but it makes it simple to add new pages.

You need to include something about this in your docs. Almost all Unix hosts support PHP and MySQL.

Check out this link for a sample page:
http://www.animecollectibles.com/acnew/ac_sm_epfigs.php3

(this posting was copied from Brian's original post at this link: http://www.uburst.com/dcforum/ushop_prog_tips/101.html )

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
2 . "PHP Sample Code"
Posted by Microburst Technologies Support Team on Nov-14-01 at 07:21 PM (EST)
If you try to view this message thread using Netscape, you might not be able to see the sample code in the above posting.

If you do not have another browser available, e-mail us at support@uburst.com and we can e-mail you some sample PHP code.

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
3 . "Getting Started with PHP"
Posted by Microburst Technologies Support Team on Nov-14-01 at 07:35 PM (EST)
One important point I forgot to mention, if you include PHP code in a web page, you will need to change the extension of that web page to be either

.php
.php3
.php4
or
.phtml

depending on the version of PHP that is installed on your server.

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
4 . "DB uShop with MySQL/Php ..."
Posted by James - Hampton Development on Nov-19-01 at 09:34 PM (EST)
Greetings,
I developed a complete admin for mysql and php which interface with uShop. Sorry, not for sale, only for licensed installs for domain sites, single users. Not for resale. It can be done very easily, just takes time to configure a scheme that will satisfy many different merchants. It's really the only way to do it, even for small sites.

Example Sites:
http://www.bagshop.com/
http://www.dutchcreekfoods.com/carlisle/
http://www.mytruckstore.com/
http://www.stonebarnfurnishings.com/
http://www.reggaecd.com/
(Currently 6,800+ CD Titles)

More can be found from our site, working pretty much the same:
http://www.hamptonplace.com/

I have them set up with cross selling options, several dynamic options, availability options, pass protected wholesale as well as retail output, specials posted to front page, tons more. Here is an old db demo template (inactive), several new options have been added.

http://www.hamptonplace.com/db_adddemo.php3

It's been a process from input of several merchants needs over time.

I've been using uShop for quite some time, it's the perfect marriage for database setup, merchants have freedom to admin completely themselves with many options.

Bill Weiner has also been a big support..;) These folks are tops!

Thanks,
James B.
Hampton Development


Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
5 . "msaccess example?"
Posted by oliver on Mar-19-02 at 07:03 PM (EST)
I would appreciate if you could explain how to do this using access with one of the codepieces that I have downloaded with Ushop? I have the database working in FrontPage. At the moment it is giving me an ASP table as output. ... Many thanks!
Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
6 . "Integrating w/Access"
Posted by Brian Levine on Mar-20-02 at 08:52 AM (EST)
Just to clarify...you are running on a Windows NT server and wish to use Access as your server-side database (I could debate the wisdom of this for a while,but I'll refrain). You want to create web pages that will integrate with this database, and you plan on using Active Server Pages to accomplish this.

Is this correct?

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
7 . "Integrating with access"
Posted by oliver on Mar-20-02 at 01:06 PM (EST)
Yup! In South Africa we do not have much choice...
The server has frontpage extensions. NO PHP or unix etc. I have one of your examples downloaded. I obviously want to replace the TAG hell with refrence to something that I can use. I will ALLWAYS be downloading the full database file so SQL is easy. This at the moment is downloaded s ASP with your java tag replicated on each line - More than sufficient for my purposes. The prob is that I now need access to the item data on the left line in ASP or someother way?
Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
8 . "ASP to Access"
Posted by Brian Levine on Mar-22-02 at 12:32 PM (EST)
Well, I'm no ASP programmer, but I think that the same structure I used would apply: You're going to need an ODBC connection to your database, and then you'll have to supply the ASP code to access the DB from your pages. Look at this PHP code snippet from my example:

// $q - sql string
// $idno - id of item in database
// $dbs - the database socket
// $cs - colspan value (defaults to 1)
$q = "select * from catalogue where Id = '" . $idno . "'";
$db = mysql_select_db("my_odbc_conn",$dbs);
$result = mysql_query($q);
$row = mysql_fetch_object($result);

The technique is fairly straightforward:
- connect to the database
- query the database

Your challange is to figure out how to do this using ASP, and then to teach the rest of us

I would like to see the good folks at uBurst to add all this info to the uShop documentation (along with the sample code). I think that a lot more people would use this approach if they knew that they could do it fairly easily (and if you have more than 10 pages of catalog items, you're crazy not to). Moreover, its the only way I know of to integrate uShop into an Inventory/Invoicing system.

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents


Archive This Thread: Admin and Moderator OnlyRemove This Thread: Admin and Moderator Only
Click here to goto Click here to goto the Lobby

 

 

 

 

 

 

 

 

 

 

 

 
Questions or problems regarding this bulletin board should be directed to Webmaster
©1997-1999 by DCScripts. All rights reserved.