Jump to content
  • Advertisement
Sign in to follow this  
pan narrans

[web] Drowning in Capitals! Help Me!

This topic is 5413 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Boy, you web dev guys sure love your acronyms, don't you? I mean: HTML, XHTML, DHTML, CSS, SQL, PHP, ASP, ADO, XML, TCP/IP, VB, JS, XSL, XSLT! Holy BeJebus! I needs help, please. Prologue Long, long ago, I built myself a nice little website using XHTML and CSS. I recently moved it from some crappy free space provided by my ISP to a fully fledged web host (with support for lots of extras). Chapter 1: The Plot Thickens So I decided to jazz up my site by making use of these little extras. I've started learning ASP, and have managed to embed some server side javascript and VBScript into it. That seems to be working fine. Chapter 2: A Long Expected Party Now I would like to start using databases. I've created a very simple one using phpMyAdmin, and I want to use it in my pages. How the hell do I do that? Do I have to use PHP, or can it be done in ASP? If I have to use PHP, can I mix it in with the ASP already in the pages? Or What? Eh? Huh? I can find info about the individual parts, but I can't find anything that will teach me the best way to mix 'n' match all this stuff.

Share this post


Link to post
Share on other sites
Advertisement
You can't mix ASP and PHP in the page, but you can probably get away with using them between pages (not sure why you'd want to though).

You could use your database if you found out how it was set up (look at the phpMyAdmin code or specs). I'm not familiar with phpMyAdmin so I can't really say, but as you're trying to integrate the two it would make more sense for you to use PHP in your pages instead of ASP. Whether you have PHP on your host is another matter. There's a few ASP CMS and database tutorial links in the Forum FAQ if you want to try writing some ASP code to deal with the database that was set up for you.

Share this post


Link to post
Share on other sites
PhpMyAdmin is just a database front end to MySQL and has no bearing on whether your application uses the database via PHP, ASP, Java, Python or anything else you care to name.

Mark

Share this post


Link to post
Share on other sites
Yeah, phpMyAdmin is a front end to a MySQL database. Can I access a MySQL database using ASP? All the tutorials I find say I have to use PHP, and that it can't be mixed with ASP. So, if I want to use this database on the same page that I also use some ASP, do I have to convert it all to PHP?

[/DumbassQuestions]

Share this post


Link to post
Share on other sites
Well, it's kindof inconsistent.

The only question is: can you find a plugin or whatever for ASP that will let you connect to MySql databases?

Share this post


Link to post
Share on other sites
Assuming that you know the database structure (tables, queries, etc) you can easily connect to a MySQL database using ADO under ASP. My host uses MySQL and I'm using it sucessfully with ASP. It all depends on what your host supports.

Imagine you've created a table called tTest, which has fields PageID (int), PageTitle (varchar 255), PageBody (largetext), you'd query an individual page with the SELECT * FROM tTest WHERE ID=insertpageid

If you host has it set up to use MySQL with ASP, you must use the MyODBC driver to connect to the database.


s_con = "driver={MySQL ODBC 3.51 driver};server=YOURDATABASESERVER;database=YOURDATABASE;UID=YOURDATABASEUSERID;PASSWORD=YOURPASSWORD"
Set ado = Server.CreateObject("ADODB.Connection")
ado.Open s_con
sql = "SELECT * FROM tTest WHERE ID=" & Request.QueryString("pageid")

set rs = ado.Execute( sql )

if Not (rs.eof and rs.bof) Then

''' Your page display logic here

end if

rs.close
ado.close

set rs = nothing
set ado = nothing





This example is VERY simple (there's security stuff you should add to it) but should demonstrate how to query a MySQL database with ASP.


In short, ask your host if you can use ASP with MySQL before you commit yourself to using ASP. Ask them if they have MyODBC installed (or any other MySQL ODBC connector).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!