Urban75 Home About Offline BrixtonBuzz Contact

website database organisation help, please.

ResistanceMP3 said:
right just downloaded Mysql five.I have installed the program, think I chose the right options :confused: , try to start the program up and got a DOS prompt. So where can I go from here to learn in two weeks how to produce a database for my website?

ResistanceMP3.

Enter password: *******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.15-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
Resistance, as a few people have pointed out, it is impossible to learn how to construct a dynamic database backed website on a single thread. It will take you weeks of study to get up to speed - and even then only if you have an aptitude for it.

Also, you can guarantee that a custom (bespoke :rolleyes: ) solution that you write will be infinitely worse than something that you can download for free from sourceforge.

By all means have a go at learning it, but you should realise that you are trying to attain the skill set of your average professional computer programmer in order to carry out a simple upgrade to your website. If the upgrade is the important thing and the learning of the skills is secondary, the options of downloading something (browse freshmeat.net or sourceforge) or paying / persuading somebody who has the skills to do it for you will be an infinitely better route.
 
ResistanceMP3. The poster above is right, you aren't going to be able to learn how to do this in a very short time. Plus, sharing the bandwidth across multiple websites will be an admin challenge.

There is an easy solution to this. Set up a Wiki. A wiki is a web page that you can edit EASILY without using any special software - If you want, people can also contribute their own files / links / comments in areas you specify - very power to the people :)

To share the bandwidth, use bittorrent. Host a link to the torrent file (very small) on the wiki, people that are willing to contribute bandwidth / hosting you just ask them to keep the torrent running. The bandwidth will be spread across the number of people and it will be much faster for people downloading. The only catch is that at least one person has to be hosting the torrent file.

This will take you a week to work out how to do, and is well documented if you google. You can set up a database and learn php if you want, but it will take you weeks if not months to get it working.

I assume you have pretty low budget - a techie could do this and write instructions for you in a few hours. PM me if you are interested. (Am I allowed to say that?)
 
A wiki and bittorrent are definitely not solutions to the problem that ResistanceMP3 described.

He wants to produce a structured catalogue of the files, which if you look at the site are hosted on external websites.

There isn't a requirement for people to automatically be able to contribute their own files. Nor is there a bandwidth issue.

For which he needs a conventional web database application, and not being a web database developer, he needs one of those, too.

Being a small and simple project, I'm sure someone that's enthusiastic and with the relevant skills could be persuaded to do it for nothing, or next to nothing.
 
Right. I've finished spluttering coffee everywhere long enough to type.

Are you lot fucking SERIOUS?? :D

It's a database. Open database, get stuff, write page. "Weeks of learning"?? Assuming resistanceMp3 has some basic knowledge of websites - and will you look at that, he's got one already - this is PISS EASY.

Look.

The database is downloadable from here, and the full source code for the ONE PAGE that this thing bloody needs, is here:

index.asp:
Code:
<%
requestedCategory = request.form("selectCategory") & ""
databaseFileName = "resistance.mdb"
databaseDetails = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE="& Server.MapPath(databaseFileName)


if requestedCategory = "" then
	
	queryText = "SELECT id, category_name FROM tblCategories "
	
	set databaseConnection = Server.CreateObject("ADODB.Connection")
	databaseConnection.open databaseDetails
		set databaseQuery=Server.CreateObject("ADODB.RecordSet")
		databaseQuery.Open queryText, databaseConnection, 1
		if not databaseQuery.EOF then
			categoriesList=databaseQuery.getRows()
		end if
		databaseQuery.close
		set databaseQuery=nothing
	databaseConnection.close
	set databaseConnection = nothing
	
else
	
	queryText = "SELECT " & _
	"tblFiles.id, " & _
	"tblFiles.file_URL, " & _
	"tblFiles.file_title, " & _
	"tblFiles.file_year, " & _
	"tblFiles.file_author, " & _
	"tblCategories.category_name " & _
	"FROM tblCategories INNER JOIN (tblFiles INNER JOIN [tblFiles-Categories] ON tblFiles.id=[tblFiles-Categories].file_id) ON tblCategories.id=[tblFiles-Categories].category_id " & _
	"WHERE tblCategories.id=" & requestedCategory & ";"
	
	set databaseConnection = Server.CreateObject("ADODB.Connection")
	databaseConnection.open databaseDetails
		set databaseQuery=Server.CreateObject("ADODB.RecordSet")
		databaseQuery.Open queryText, databaseConnection, 1
		if not databaseQuery.EOF then
			filesList=databaseQuery.getRows()
		end if
		databaseQuery.close
		set databaseQuery=nothing
	databaseConnection.close
	set databaseConnection = nothing
	
end if


%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>Files</title>
</head>

<body>

<%
if requestedCategory = "" then
%>

	<form name="f1" id="f1" action="index.asp" method="post">
		<select name="selectCategory" id="selectCategory">
	
<%
	for i=lBound(categoriesList,2) to uBound(categoriesList,2)
		categoryID = categoriesList(0,i)
		categoryName = categoriesList(1,i)
%>
			<option value="<%=categoryID%>"><%=categoryName%></option>
<%
	next
%>

		</select>
		<input type="submit" value="Get stuff" />
	</form>



<%
else
	categoryName = filesList(5,0)
%>


	<h2><%=categoryName%></h2>
	<a href="javascript:history.go(-1)">back</a>
	
	<table cellpadding="3" cellspacing="0" border="0">
		<tr>
			<th>Author</th>
			<th>Title</th>
			<th>Year</th>
		</tr>

<%
	for i=lBound(filesList,2) to uBound(filesList,2)
		fileID = filesList(0,i)
		fileURL = filesList(1,i)
		fileTitle = filesList(2,i)
		fileYear = filesList(3,i)
		fileAuthor = filesList(4,i)
%>
		<tr>
			<td><%=fileAuthor%></td>
			<td><a href="http://<%=fileURL%>"><%=fileTitle%></a></td>
			<td><%=fileYear%></td>
		</tr>
<%
	next
%>
	
	</table>

<%
end if
%>

</body>
</html>


Right. Is there ANYTHING in those 125 lines of code that a moderately intelligent 10-year-old with a Visual Basic Script reference couldn't figure out? Anything at all that requires weeks of training? Maybe there's some gigantic leap of conceptual thinking hidden somewhere in between opening a database connection and using it to send a query to the database? No?

Well, tell me then. I'm genuinely confused here. What is it exactly that's so hard about this simple task that it's got you lot all running for your portal frameworks and CM systems? In the time that you've spent typing reasons not to try doing it, you could have built it, implemented it, debugged it and rewritten it in Delphi. :confused:


Right. I've shown you mine. Now do your worst :p
 
Wintermute said:
Well, tell me then. I'm genuinely confused here. What is it exactly that's so hard about this simple task that it's got you lot all running for your portal frameworks and CM systems? In the time that you've spent typing reasons not to try doing it, you could have built it, implemented it, debugged it and rewritten it in Delphi. :confused:
Anyone who makes web applications in delphi is asking for trouble. Anyone who assumes a non-programmer can understand any of that ghastly VBScript *spits* is asking for trouble.

So there :p
 
Wintermute said:
Well, tell me then. I'm genuinely confused here. What is it exactly that's so hard about this simple task that it's got you lot all running for your portal frameworks and CM systems? In the time that you've spent typing reasons not to try doing it, you could have built it, implemented it, debugged it and rewritten it in Delphi. :confused:

Um.. Think back to before you knew how to program, back to before you knew how to construct a database. Thats where Resistance is... Good for you that you can do it in 125 lines -- not everyone is a high and mighty programmer like you are.

Anyway... Do you worst...? :confused: Whats a mdb file when its at home...? :D
 
Delphi was.. an example plucked from the air. I wasn't actually suggesting it. That would be stoopid.

VBScript is a lot more human-readable than many other languages - especially that bastardised son of Perl, PHP: the scripting language that sounds like a wet fart. And besides, choice of scripting language isn't the point. Is what the code above achieves any more difficult in PHP? Of course it isn't. It's straightforward snippets that you could copy and paste from anywhere.

I'm not a high and mighty programmer. I'm a professional, yes, but I haven't done anything in the code above that would require professional experience. It's basic scripting, tutorial level. I mean, who actually DOES the "hello world" tutorial? Nobody. You jump straight into the "how do I connect to a database" and "how do I get data from forms" ones. And that's all that this does.

Access... well, like I said. I'm not going to spend too much time defending it. I agree with most of the criticisms, just to a lesser extent. It's not THAT unreliable, and if you don't stick the damn thing in your root directory with a big link going "here's where the database is", then it's not THAT unsecure.

I mean, come on. Read the code. It might not be pretty, but it makes sense. And that's not because it's in VBScript, or (God help us) because I wrote it. It's because it's fundamentally simple. Connect to a database, get some data, loop through it. It's the data structure that's important. Get that right and the code writes itself.
 
Wintermute said:
I mean, come on. Read the code. It might not be pretty, but it makes sense. And that's not because it's in VBScript, or (God help us) because I wrote it. It's because it's fundamentally simple. Connect to a database, get some data, loop through it. It's the data structure that's important. Get that right and the code writes itself.

It's simple, because you know how to program. I'm sure 'hello world' is simple in chinese, if you can read and write chinese.
 
Wintermute said:
I'm not a high and mighty programmer. I'm a professional, yes, but I haven't done anything in the code above that would require professional experience. It's basic scripting, tutorial level. I mean, who actually DOES the "hello world" tutorial? Nobody. You jump straight into the "how do I connect to a database" and "how do I get data from forms" ones. And that's all that this does.

Yep, but you need to know what a database does, why you need to connect to it, which is the best database for the job at hand, which language you should use & and how to make sure everything works together...

You may be a professional programmer but not everyone is...
 
fractionMan said:
How can a table not have a primary key (even if it's multiple fields)? Bloody access.


epends on the databas eand what you are doing with it.

sometime a key or index is not required
 
Wouldn't it be easier to take something off the peg such as one of the php open source CMS, or that php jukebox (ideal for organising audio) I came across some time ago that uses sql-its probably on hotscripts.

Then again this is a stock answer for me since all my sites tend to be driven by postnuke .75.

jukebox here:

http://www.jinzora.org/demos/standalone/classic.php

I think it can be integrated into postnuke.
 
Back
Top Bottom