Basic task, unfortunately i have no idea how to do it!

Associate
Joined
24 Nov 2007
Posts
888
Location
Leeds
Hi,

Basically, what i'm doing is designing a very very very simple website.

There will be a search box. It will comprise of Male (tick box) Female (tick box) and an age box, where you put in the desired age you are looking for.
Looking roughly like this!
example.jpg


Yeah, its supposed to be a very basic dating site. So you put in the sex/age you are looking for and you get a list of results.

Right! Now for the bit i have no idea how to do.

I need to make a database containing all of the results. Say 10 'people' of varing age and sex.

I then need to link the database to the search feilds, and then create a page to display the results.

I've been trying all sorts of things, reading guides for this and that. All i want is the most basic way of doing this. I'm getting confused! asp, php, mysql, apache, blah blah blah....it's all confusing me. I just want the simplist way!!

Everything must be contained on my computer (i dont have web space for a database). It all needs to be handed in on a cd.

Basically, the aim is to prove i can get the website to request data from the database and show the results.

Please, someone help me!

Thanks :),

Gil.
 
You don't need a webspace rented etc. You can do this with Apache on your computer with mysql holding the data in the background. The glue inbetween is usually php.


Sorry for my previous answer - I read it as a "please do my university homework" which is rather insulting for those that slaved in the past.
 
Last edited:
I hope this isn't uni level! College I'm guessing.

But as said, no-one's going to just do you work for you. How will you learn?

Anyway you'll want to use PHP and MySQL and Apache so you can parse PHP on your PC.
 
PHP is probably the easiest way. If you install WAMP (google it) it will come with MySQL and phpmyadmin so you can create a db/table and add some rows. What you'll most likely want to use is a script that handles the post data (read some tutorials) and uses this to create an SQL query and serve the results.
 
If your totally stuck on the PHP/SQL side, use W3Schools to help. Really useful to refer to if you're stuck.

I'm guessing you'll want to query (SQL) your 'People' table with the criteria entered on the site, and then return each row found in the database using a PHP loop.

Hope this helps.
 
Install XAMPP on your PC for an instant apache-php-mysql setup.

The sql database should be pretty easy, just make sure it can be kept relational if the task will be extended (or for extra marks, possibly)

The PHP is quite simple, just check the input sex and select all where the sex is not the same as the one input (or is the same as the sex required, may make more sense) then loop through the results.
 
ok, all this confused the hell out of me. I found a guide telling me how to do a few things that i need using asp and Access databases.

So, this is where i'm at,

I have created a database with 10 men and 10 women of varying ages, this database is located on the server.

I can call up the whole table using this asp script,

Code:
<html>
<head>
<title> Browsing a database file </title>
</head
<body>
<%
   Set MyConn=Server.CreateObject("ADODB.Connection")
   Set Rs=Server.CreateObject("ADODB.RecordSet")
   MyConn.Open("cgilboy-access")
   Rs.Open "SELECT * From SinglesList", MyConn, 1, 2
   Response.write("<TABLE BORDER=1> <TR>")
   
FOR i=0 TO Rs.Fields.Count-1
    Response.write("<TH>" & Rs(i).Name &"</TH>")
 NEXT
   Response.write("</TR>")
   
   Response.write("<TR>")
   While NOT Rs.EOF
    FOR i=0 TO Rs.Fields.Count-1 
	Response.write("<TD>" & Rs(i) & "</TD>")
    NEXT
    Response.write("</TR>")
    Rs.MoveNext
   WEND
   Response.write("</TABLE>")
%>
</Body>
</html>

SinglesList being the name of the database file.

So, I then need to link the database to the search feilds, and then create a page to display the results. I have no idea how to do this, i can't find a guide?

Can anyone help!? Please!?
 
Do they not teach you this in your degree? I don't know ASP so I can't help you, but with PHP it's quite straight forward. Read some tutorials and you'll understand.
 
ok, all this confused the hell out of me. I found a guide telling me how to do a few things that i need using asp and Access databases.

So, this is where i'm at,

I have created a database with 10 men and 10 women of varying ages, this database is located on the server.

I can call up the whole table using this asp script,

Code:
<html>
<head>
<title> Browsing a database file </title>
</head
<body>
<%
   Set MyConn=Server.CreateObject("ADODB.Connection")
   Set Rs=Server.CreateObject("ADODB.RecordSet")
   MyConn.Open("cgilboy-access")
   Rs.Open "SELECT * From SinglesList", MyConn, 1, 2
   Response.write("<TABLE BORDER=1> <TR>")
   
FOR i=0 TO Rs.Fields.Count-1
    Response.write("<TH>" & Rs(i).Name &"</TH>")
 NEXT
   Response.write("</TR>")
   
   Response.write("<TR>")
   While NOT Rs.EOF
    FOR i=0 TO Rs.Fields.Count-1 
    Response.write("<TD>" & Rs(i) & "</TD>")
    NEXT
    Response.write("</TR>")
    Rs.MoveNext
   WEND
   Response.write("</TABLE>")
%>
</Body>
</html>
SinglesList being the name of the database file.

So, I then need to link the database to the search feilds, and then create a page to display the results. I have no idea how to do this, i can't find a guide?

Can anyone help!? Please!?

Would personally ditch classic ASP and use PHP. This is very basic stuff and there are tons of tutorials - see http://www.asptutorial.info/ as the first result in google.

EDIT: if you're using the script to display all the data then to display search data you'll need to amend you sql query - most likely adding a WHERE clause.
 
Yes you can, using ODBC connections you can connect to your Access database using PHP.

Although if im honest your much better off using mysql for it, what your asking for is fairly simple to create even for a novice, a basic tutorial on php/sql will give you enough knowledge to create what your after.

Small tutorial on using Access database with PHP.
http://www.w3schools.com/PHP/php_db_odbc.asp
 
Back
Top Bottom