Jump to content

What do I need, where to start?


SmokingMan

Recommended Posts

I have a collection of thousands of cards, comics & collectibles I would like to put on a site. I would like for the user to be able to pick what they want, have the price along with shipping calculated, and then sent to me. I would have a PayPal link for them to pay for the items. I also would like for the site to show the current items available, so when a user orders something, it would be automatically removed from the database.I know a commercial shopping cart program would work, but I don't want to sink the money into one at this point, since this is more a hobby than a commercial enterprise. I know I'll need to have the database loaded on the server. MySQL is installed on the server so I know I need to learn that. It would be nice if you could convert an Access database to MySQL since I am familiar with Access but not so much with MySQL. But how would I accomplish linking the website with the database so customer purchases would be reflected the next time the page is loaded, PHP?I have lots of questions, but this is something I would like to do. I'm comfortable with XHTML and CSS, and somewhat comfortable with Javascript. Am I getting in over my head here? What do I need to learn to accomplish this? Any suggestions would be appreciated.

Link to comment
Share on other sites

Yes. PHP or any server side scripting language (which you probably don't have at your disposal) can be use to connect to the MySQL database.If you host your site on your computer, you could set an ODBC connection with the MDB.You can use a tool like MDB2MySQL to convert your MDB file to MySQL compatable one, but your host must still allow you to import databases. Otherwise... change your host or host your site on your computer.

Link to comment
Share on other sites

My sites are hosted by ICD Soft. Both MySQL and PHP are installed on the server, and I can import a database to the server. So all of the tools I need are there, but not on my home system. I do have MySQL Express downloaded but not installed, and I have a PHP reference CD which has what I need to install it on my home system. It looks as if I have my work cut out for me :)

Link to comment
Share on other sites

ICDSoft is a fine host, I have my website for my own business hosted there. You can click on the MySQL Database link on the control panel page and create a new database and a new database user, and then there is a PHPMyAdmin link on that page as well for you to log in and manage the database. You can use PHPMyAdmin to import or whatever else you need to do with the database. You won't have any problems with the host though, you should have everything you need on the server.

Link to comment
Share on other sites

I've had my sites hosted with ICD Soft for about four years now, and I have no complaints. I know I have all of the tools I need, now all I need is the knowledge on how to use them.An easy way out would be nice, but I really do want to learn how to do this...I think :)

Link to comment
Share on other sites

It actually shouldn't be too bad. You need at least 5 database tables, and only a few pages to show everything and take the orders. Obviously, you will want one table for products, so that's one. It will look something like this, also make sure you include whatever other information you want to keep track of:productID - int, autonumbername - varchardescription - texttypeID - intprice - floatin_stock - intin_stock would be the number you have. typeID refers to a table for types, where you can add and remove however many types you want (baseball cards, figures, whatever). So the types table would look something like this:typeID - int autonumbername - varcharPretty simple there. You would add a new type with a name, and the autonumber ID would get generated automatically. When you add a new product, you would display all the types in a dropdown list or something and then store the ID of whichever type you choose in the products table. A third table would be users, these are the people who place orders. They need an email address and password to sign in with if they come back again, and allow them to see their old orders and things. A simple users table would look something like this:userID - int, autonumberemail - varcharpassword - varcharname - varcharaddress1 - varcharaddress2 - varcharcity - varcharstate - varcharzip - varcharcountry - varchar (if you want to ship internationally, I'm assuming you're in the US)When someone signs up, they would give you all of that information (except the ID, which gets generated automatically). There is a regular expression you can use to make sure the email address is a valid format, and you will encrypt the password before putting it in the database. The password field in the table needs to be at least 40 characters long for the encryption.So that takes care of products, product types, and users, and the next thing is orders. Orders are pretty simple, but you might want to have a separate shipping address just in case they use a different one then is in their user record. So orders would look something like this:orderID - int, autonumberuserID - intcartID - intprice - floatname - varcharaddress1 - varcharaddress2 - varcharcity - varcharstate - varcharzip - varcharcountry - varcharAnd then the shopping cart table, which just holds an ID number to relate to a user. There will be one more table which will hold all of the items in the cart.cartID - int, autonumberuserID - intcart_items table:itemID - int, autonumbercartID - intproductID - int, holds the ID number of the product from the products tablequantity - intAnd that's basically it for the database. A person checking out might have data that looks something like this:his user info:userID=123name=John Smithemail=john@smith.comaddress1=123 Main St....cart info:cartID=789userID=123cart items:itemID=100cartID=789productID=10quantity=2itemID=101cartID=789productID=20quantity=1order info:orderID=999userID=123cartID=789price=59.99name=John Smith...You would include the price in the order table so that in case you change prices for your products, the order table still shows the price that the user paid for that order, instead of an updated price for the new items.Hopefully you understand this part, let me know if you don't. Once you have your database set up, it pretty much becomes a process of making pages to use each table. You need a page to manage the product types, and then a page to manage the products, and then a page the user sees to browse all the products, the order page, etc. You may need a few more fields in the order table if you have different shipping methods, and somewhere you will need a password-protected login for yourself to login and administer everything.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...