Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
how to connect a database with pure html codes?
Old 05-22-2008, 12:27 PM how to connect a database with pure html codes?
Banned

Posts: 2
Trades: 0
I am doing a simple webpage with pure html codes and I want it to connect with database(MySQL)... I have no any idea if it is possible to connect a database with html code only...

so..my question is:
Can i work with database with just html codes? if so..how can I connect a database?
or if not.. what should I do so that I can work with database? what are the codes?

somebody...thanks...
williamutley is offline
Reply With Quote
View Public Profile Visit williamutley's homepage!
 
 
Register now for full access!
Old 05-22-2008, 12:41 PM Re: how to connect a database with pure html codes?
VirtuosiMedia's Avatar
Web Design Made Simple

Posts: 1,228
Trades: 0
You might be able to connect to SQLite using JavaScript, but other than that, you'll need to use a server language like PHP or ASP to connect to a database like MySQL, PostgreSQL, etc. You won't be able to do it with just HTML.
VirtuosiMedia is offline
Reply With Quote
View Public Profile Visit VirtuosiMedia's homepage!
 
Old 05-22-2008, 02:09 PM Re: how to connect a database with pure html codes?
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
JavaScript should be able to do it, at least against SQL Server. But you have to configure the database in a way that most hosts won't allow, due to risk. Plus, we're not talking about Microsoft products.

To get into (ie connect to) a database, you need to supply credentials. Those tend to come in one of two forms. Either you've got a user name and pass phrase combination, or you're logged into a network (typically Windows NT) and by virtue of your AD account, you're granted (or denied!) access to the database. With HTML, we have a problem.

The markup can run on any computer or cell phone in the world. So right there, single sign on is out. And because I can look at a web page, and email it to someone else, you can't put a password into it!

That leaves ASP.NET, PHP, or some other server side development framework. What these do is run your custom logic (ie querying a database) and then build an HTML web page from what it learns.

And that, in turn, brings up another issue. A database doesn't answer your queries in HTML format. The server code takes the answer, and converts it into something your browser knows how to display.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 05-22-2008, 08:31 PM Re: how to connect a database with pure html codes?
joder's Avatar
Flipotron

Posts: 6,442
Name: James
Location: In the ocean.
Trades: 0
http://us3.php.net/mysql_connect

Your going to need more than that but php.net will get you started in the right direction.
joder is offline
Reply With Quote
View Public Profile
 
Old 05-23-2008, 08:28 AM Re: how to connect a database with pure html codes?
vividearth's Avatar
Experienced Talker

Posts: 33
Location: London, UK
Trades: 0
imo this is a bad idea. You would need to use javascript and more precisly ajax to make the server calls. This would still leave you needing something server side to answer the ajax calls. In MS SQL you can set the server up to deliver XML over http which would work fine but I am not aware of MySql having this ability. I would also tend to keep the database server bound and behind a layer of abstraction (ie some code). Better to bite the bullet and learn a language (i recommend php or ruby for beginer). When starting out a little code can go a long way. You are really just following the pattern:

1. Get data from database.
2. Do some processing/formatting.
3. Render data to screen.

very quick to learn these basics.

If you really cannot do this I would take the route of prebuilding the html files from the database. I assume you know how to query a database, so (horrible as it may be), you could write queries to generate the html content on a nightly basis and then upload these.
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
vividearth is offline
Reply With Quote
View Public Profile Visit vividearth's homepage!
 
Old 05-23-2008, 05:43 PM Re: how to connect a database with pure html codes?
VirtuosiMedia's Avatar
Web Design Made Simple

Posts: 1,228
Trades: 0
I would imagine that there would also be significant security issues if you're connecting through JavaScript as it's viewable from the browser. The only way I would recommend it is if you're building a desktop app using Adobe AIR.
VirtuosiMedia is offline
Reply With Quote
View Public Profile Visit VirtuosiMedia's homepage!
 
Reply     « Reply to how to connect a database with pure html codes?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24509 seconds with 12 queries