View Full Version : Need website code allow users to sort search based on their preferences?
Phatpipe5
09-19-2003, 09:34 PM
I am trying to write code to allow users to choose to sort and search based on their preferences. Example: Type of toy, Cost of toy, toy gender and do search sort of a database(I presume)
to show items that match their specific interest.
I am comfortable with Javascript and HMTL so I have all the dropdown option box forms integrated with site HTML.
It appears this may involve server-side scripts and databases.
I have a basic understanding of SQL (via Access).
1) Could anyone point me in the right direction as to where I could find more information on how to do this.
2) What languages should I be using if serachable and sortable databases (with graphics) are used? SQL with PHP? with DHTML?
Thanks for any help in advance. I am somewhat of a newb when it comes to hardcore webcoding!
Phat
:rolleyes:
Welcome here.
You indeed need a server side language + Database for this.
The most common combinations are
ASP with MsAccess or MsServer
and
PHP with MySQL
Which to choose depends on your hosting specifics + the time you plan on investing into coding/db-management in the future.
ASP/Access is a bit easier and userfriendly, but a bit more expensive to host.
PHP/MySQL is a bit more difficult to get started with, but is a far more powerfull combination, and is cheaper
Take a look here at some tutorials or scripts
ASP or PHP : http://www.hotscripts.com/
ASP or SQL : http://www.w3schools.com/
Phatpipe5
09-22-2003, 10:45 PM
Hi Raf. I appreciate the time you took to answer my questions.
I started to look at both methods and oh-by-gollee as technical as I am and as versed as I am with hard coding html and some jscript...I find it difficult and feel there may be a long learning curve ahead. I understand the premise and set-up of Access and ASP scripts, etc. but am not sure how to generate code other then by trial and error (and for me it would be a lot). Also, the actual implementation of scripts with OBDC, DSN, DSN-less, etc, etc, lol ....all very daunting when facing tight time frames.
I have to weigh the necessity of whether to jump in with both feet and take my usual 'I must learn everything myself' attitude or hire someone who knows what they are doing and can write some code for what I require. It seems that the code I need might take an expert 20 minutes to produce as the rest of the site and database is done. lol
How does one go about finding and hiring a developer? Since I would imagine there are no geographic bounds...I would imagine there are a lot. Any thoughts?
Also the database that I am planning linking is anywhere from 200 to 2000 entries with at least 8 or 9 colomns. Someone suggested exploring Java via CGIbin and a Flatfile format (text)but I have read that this is not appropriate for larger db and to stick with relational db as it could lock-up.
So much of the code I have seen for db is for e-commerce or things like that and I am guessing that it might be overkill for what I am looking.
Help! confused newb :confused:
How does one go about finding and hiring a developer? Since I would imagine there are no geographic bounds...I would imagine there are a lot. Any thoughts?
You could hire me :)
Or just explain what you need and we will probably have some example code for it lying around.
ASP is quite easy to learn, since it has incredably easy syntax.
(Of course, there is a difference between getting something running, and writing solid code ...)
But if you are thinking of getting seriously involved with server side coding, i'd suggest PHP.
Someone suggested exploring Java via CGIbin and a Flatfile format (text)but I have read that this is not appropriate for larger db and to stick with relational db as it could lock-up.
If you need to do some efficient, online selects, then db's are the way to go.
Storing in txt files is OK if it's just writing (like logs and stuff) or batchprocessing (do this for each entry) but for selects, they aren't really efficient + the lock the complete file, while in a db, only one record (or even less for some db-formats) is locked.
Phatpipe5
09-27-2003, 12:57 AM
Sorry Raf. Just got back into town with time to browse...
I'd love to hire ya:thumbsup: but if you have example code laying around that would be better:D I still have a week or so to learn
What I am trying to do with ASP/Access DB is return a search query based on a number of criteria.
Example: Database has 2000 records of different types of pens.
User can choose (my method is dropdown):
blue ink, once choice is made..the next drop down box is various brands of blue ink pens.
another drop down will allow them to choose price range options:
>$1, $1-1.50, $over 1.50.
Standard submit. The ASP server script will check the database and pull the records that match and generate the template http page with the dynamic listings, complete with thumbnail, and description fields from DB coloumns.
Of course, I don't mind manually entering DB records but at some point I'd like to have a way to add records from a secure page via www remotely.
This site will not require a customer (or userid) type account log-in for access or for searching an getting information.
So there you go..that really is the extent of it. Pretty much the rest of the website is complete. Still reading the W3schools which by the way is EXCELLENT!
Thanks, Phat
:)
oracleguy
09-27-2003, 01:31 AM
Originally posted by raf
Take a look here at some tutorials or scripts
ASP or PHP : http://www.hotscripts.com/
ASP or SQL : http://www.w3schools.com/
Hey raf, dunno if you saw but W3Schools now has a PHP tutorial too.
Phatpipe5, the script(s) that you are going for are not that difficult to build once you have a good database design. The page to run and display the search wouldn't be too difficult to pump out. If raf doesn't want to do it, I'll do it.
And it is easy to write a page to add records into the database too.
About the dependen dropdowns:
I posted some code here (go straigth to the last post, open the attach)
http://www.codingforums.com/showthread.php?s=&threadid=22231&highlight=multiple+dropdown
The advantage of that code is that you can have unlimmited number of dependend dropdowns.
Each time an option is choosen and the page is submitted, then you get the next dropdoxn, that uses all previous choices as a condition.
To add another droipdown to the screenflow, you only need to add something like this at the top :
if session("state") = 5 then
if request.form("model") = "0" then
session("state") = 4
else
session("model")=request.form("model") 'model = model --> what sort of plate
end if
end if
--> so that you can trap false submits
and add your new dropdown
case 2
%>
</td>
<td align="right" width="50%"><input type="hidden" value='<%=request.form("soorten")%>' name="soorten"><select name="afwerking" size="1">
<option value="0" selected>Kies ...Dikte<%
dim rsAfwerking
set rsAfwerking = server.CreateObject("adodb.recordset")
dim sqlafwerking
sqlafwerking="SELECT distinct nummer,naam from afwerking INNER JOIN prijzen ON prijzen.afwerking = afwerking.nummer WHERE prijzen.type=eentype" _
& " and prijzen.soort=desoort order by naam asc"
sqlafwerking = replace(sqlafwerking,"eentype",soorttype)
sqlafwerking = replace(sqlafwerking,"desoort",session("soort"))
rsAfwerking.Open sqlafwerking, conGranIT
if rsAfwerking.EOF=true then
Response.Write("Er kon geen keuzelijst met afwerkingen gegenereerd worden. ") ' "There couldn't generated a dropdownlist with the surfacetypes"
else
do while rsAfwerking.EOF=false
Response.Write("<option value=" & rsAfwerking.Fields("nummer")& ">" & server.HTMLEncode(rsAfwerking.Fields("naam")))
rsAfwerking.MoveNext
loop
end if
rsAfwerking.Close
set rsAfwerking=nothing
conGranIT.Close
set conGranIT = nothing
session("state") = 3
But just take a look at the code and you'll see the pattern.
Just post back if you have question, or start a new thread in the ASP forum
This is another thread with links to javascript sollutions (but with a 2k tablet that's madness) + where i posted code to have multiple depended boxes inside 1 framepage (all boxes stay visible, they just come below eachother ---> if you change one above, all the lower are reset) or inside a regular multipurpose page (incase you only have a few dropdown + some other formfields)
http://www.codingforums.com/showthread.php?s=&threadid=15258&highlight=dropdowns
If you need a login-script, just run a search in the ASP forum. I've posted a few there + you'll find lotts of links to others.
<edit> i misread the login part.
About the inserts : when you get there, just start a thread in the ASP forum. I think however that you will need to create some sort of admin-section for that, because else, anyone can enter new records.
A year back, i wrote an online db-admin tool for MsAccess and MsServer. It lets you create and alter tables, columns, indexes, delete records, update them etc. (it of course has a login screen etc) I planned to document it a bit and make a download package of it btt never found the time to do that). If you're interested, send me a mail and i'll get you started with it.)
Fully generic, if you start using it from a blank db (else you need to enter some data about each column in an administration table).
So you just copie the files to your server and fill in the rigth db-adress and you can start designing and managing your db)
Oracleguy,
No. Didn't see that. Good to know. I took a quick look at it and i think it s realy to brief. I'd recommend that if anyone reads a section of it, then that they look up the details at php.net.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.