Arrays and functions?

    Date: 12/13/05 (Web Development)    Keywords: database, asp, sql

    Amazingly enough, I've *just* started using functions with my ASP code, even though I've been doing ASP for a little while now.

    Right now, I'm only using a function to deal with connecting to my database and retrieving information based on the SQL I use.

    In several cases, however, I need to use multiple recordsets for part of a page's content. It gets a little tiresome to use the same function over and over.

    Is there a way that I could store all of my SQL statements in an array and then use that array in my function so that it would run through however many items there are in the array (this could not be a static number, since one page might use four different statements and another might use three), run all the SQL statements, and then put the results in different recordsets?

    Or..would it just be easier to make one huge SQL statement, like

    SELECT table1.field1, table2.field1, table2.field2, table3.field5 FROM table1, table2, table2 WHERE
    ... etc?

    Sorry if this question seems inordinately stupid.

    Source: http://www.livejournal.com/community/webdev/278824.html

« Documentation site... || Arrays and functions? »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home