PDA

View Full Version : ASP Database HELP !!


NEO
06-30-2003, 11:57 AM
Hi, i know how to connect to the database & disply the first record in a database, e.g to display the the first record in the "Name" colum you would type the database connection then <%response.write ors1 ("Name")%> and it displays the first recored in the "Name" colum.

But how can i disply certain parts of the database e.g like this message board. My message will be put into a database and the Url for it would be somthing like "View?x=Message55"

What would the code be to do that in ASP? its the same as how data driven websites work. If any has any ideas, please help.

P.S Has anyone noticed that most good apps and websites are built in PHP now, But ive gota say, PHP seems to have better apps like message boards & chatrooms. And the best thing about them is thats there are mostly free unlike ASP. Have i chose the wrong language to learn ????

Kodo
06-30-2003, 12:42 PM
you have to pull the record id from the db on one page and put it into your link like so.

<A href="blah.asp?id=<%=RS("recordid")%>">Click here to view</a>

so on the second page you request that id..

RecID=request.querystring("id")

Then you pull out info from the db based on RecID and place the data in the tables.



as for why PHP is more common. simply put, ASP ONLY runs under Windows. PHP runs under both windows and Linux. Aside from that, nearly all of those sites use MySQL database (free) instead of MSSQL or Access.
Did you pick the wrong language? That's entirely up to you to figure out. I tried PHP4 and frankly, I thought the syntax was horrid and MySQL doesn't support Stored Procedures which improve database speed vastly.