| Author |
Topic  |
|
|
iesus
Starting Member
Sweden
14 Posts |
Posted - 13 Feb 2006 : 9:12:37 PM
|
FlatFile (Text) database in PHP, without SQL or any other complex database system.
Requires basic HTML knowledge and very basic PHP (or just common logic sense) skills + a server that supports PHP.
Hi all, I have now developed a PHP database easy to include in your NebuCart site,
It can now handle 15 options (five colors 10 sizes), but it easy to add more or change for diffrent options.
the script contains 5 files one database and four php files.
one for Size & colours one for Variables one for functions and one for nesting and look and feel
on top of that the package contains a CSSfile a picture a htmlfile and a INSTALL file. these are only for veiwing an example help you figure the script out, and implanting the script on your webpage.
Dont hesitate to send a mail and i'll help you out as soon as i can, a webpage that i am implanting the script on check it out: http://www.odiumclothing.net
and the script can you find here: http://server.allanthya.net/DataBase/
There is also a searching script for the database, if someone is interested,please se odiumclothing.net for how it works. I have recently finnished my graphical online database manager for the database, it can manage discount codes, Cataloge database, colorchart database and item database.
There is also a Catalog database available, on the same site. And a database wich uses a Color chart.
The whole package is under the GPL and therefor served w/o warrenty, but on the other hand it is all free and you can change whatever.
Sourcecode available in .rar or .zip format.
//Iesus |
Edited by - iesus on 20 Jul 2007 4:37:14 PM
|
|
|
Gazza
Moderator
United Kingdom
633 Posts |
Posted - 14 Feb 2006 : 03:09:10 AM
|
Hey watcha fella,
This is working great on your site and it didn't take you long to do either, but then no doubt, you've been up 'til the wee small hours.
If you look at my CD in NebuCart.js on line 1000, it pulls in an array() of colours which is set by "colour = thisProduct[5].toString().split(',');" on line 960.
This will allow an unlimited number of colours, likewise the sizes are an array(). You won't need to abbreviate the sizes like I did, so this will allow for unlimited sizes too rather than specifying a set amount of colours and sizes and having to build a function for each.
Now, as you know my friend, I know nothing about PHP but, if I'm reading it right, rather than calling a function to get each of the product elements, can you not PUSH the whole array() line into the $pages_found variable?
for (i=0; i<dBase.length; i++){ //Loop through the DB
var gaz = dBase[i].split('|'); //Split into product components
var Occurence = 0; //Start counting
eval("myRE = /" + key + "/gi"); //key is the search criterion
OccurArray = gaz[qry].match(myRE); //qry is which component to match using myRE
if (OccurArray != null) Occurence = Occurence + OccurArray.length;
//If it matches add Occurence number to the number of array() elements
if (Occurence > 0) { //If the array() is greater than 0
result[indexer] = (0-Occurence) + "|" + dBase[i] ;
//result array() now contains Occurence number + | + the rest of the components for that product
indexer++; //Increment indexer number to push new item into the array()
}
}Search once, then extract each product line from the product DB array() which matches the query, then PUSH them into the result array() which will then hold each line of the matched data which you can then split into components containing the separate product elements. That's what I pass to showProducts(result,key). The result is just the matched data as an array() and the key is the search criterion.
See if you can get it to work, it'll mean a lot less coding and it will be a lot more efficient.
Speak soon,
Gary |
Edited by - Gazza on 14 Feb 2006 03:44:29 AM |
 |
|
|
iesus
Starting Member
Sweden
14 Posts |
Posted - 14 Feb 2006 : 03:46:21 AM
|
I will defenetly look in to that, i have tried but with that help this is absolutly doable :)
//Iesus |
 |
|
|
Gazza
Moderator
United Kingdom
633 Posts |
Posted - 14 Feb 2006 : 04:19:02 AM
|
Go on, you can do it... 
Look at us two, here I am replying to you at 4.20 in the morning after you replied to me at GMT+1.
No rest for the wicked... 
Good luck,
Gary |
 |
|
|
iesus
Starting Member
Sweden
14 Posts |
Posted - 04 Mar 2006 : 2:25:09 PM
|
It will be put on hold, i have looked in to it and it is possible the thing is just to get it to understand wich row to pull data from.
i'll problably be able to do it as soon as i finnish school, since now i'm in the last few weeks of last year.
It will be done as you did it in your database (x|x|x|x, x, x, x|x,x,x,x|x|x(comma separated colours and sizes instead of |-separeted)
There are just so many diffrent ways of parting string and making it arrays.
//Iesus |
 |
|
|
Gazza
Moderator
United Kingdom
633 Posts |
Posted - 04 Mar 2006 : 2:56:31 PM
|
Hi Iesus,
Yes I know, there are so many different ways to split or pull in the data from an array.
I'm now working on my JavaScript database, like on my lingerie site. I'll be offering different templates for the look with complete CSS display control.
It will probably be one file for the database, then another template file depending on how you want to display the products.
With PHP, you may want to use the database connectivety available for mySQL etc. So PHP users can upload product data into the mySQL tables which your script can then pull in and display.
What I'm hoping to do is include the JavaScript database functionality with the FULL version only. If you wanted, we can arrange something similar with your PHP solution.
Good luck at school,
Gary |
 |
|
|
iesus
Starting Member
Sweden
14 Posts |
Posted - 05 Mar 2006 : 2:57:04 PM
|
There are already many finnished SQL solutions out there,
I wanted a flatfile database because there are people that 1, dosn't know shi*t about SQL 2, dosn't have access to SQL-servers
therefor i wanted it to be Flat-File i have no plans making it SQL, but i can always look in to it later on.
The script i made is offcourse opensource and can be fullversion only or if you like to give it with free version this is also OK for me,
i will ofcourse not deny anyone that asks if they can get the script thou.
The look and feel is located in ONE file, similar to the settings file of nebucart, but it includes HTML and CSS. |
Edited by - iesus on 12 Apr 2006 03:43:15 AM |
 |
|
| |
Topic  |
|
|
|