Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - SQL location
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SQL location

 Post Reply Post Reply
Author
Aumuz View Drop Down
Groupie
Groupie
Avatar

Joined: 14 March 2003
Location: United States
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aumuz Quote  Post ReplyReply Direct Link To This Post Topic: SQL location
    Posted: 19 August 2003 at 9:55pm

I am working on somthing were I have 3 files.

config.asp

check_user.asp

skin.asp

They are all located withing the same folder, and are included into the sites default page in the order I gave them.

The thing is, I would like to have the following statment in my config.asp...

SQL_set_skin="SELECT table_skin.* FROM table_skin WHERE skin_name='" & user_skin & "';"

The problem is, user_skin is not set untill check_user.asp, so I need to have it in skin.asp.

Is there anyway I can do this?

Back to Top
farrukh View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2002
Location: Pakistan
Status: Offline
Points: 147
Post Options Post Options   Thanks (0) Thanks(0)   Quote farrukh Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2003 at 2:16am
make a default skin
user_skin = yourdefaultskin.asp

SQL_set_skin="SELECT table_skin.* FROM table_skin WHERE skin_name='" & user_skin & "';"

check out the records if found then use user skin else use default skin
i have collected some nice avatars (37) and smileys (227) here you can download
http://www24.brinkster.com/webmastertool/download.html
Back to Top
Aumuz View Drop Down
Groupie
Groupie
Avatar

Joined: 14 March 2003
Location: United States
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aumuz Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2003 at 6:57am

I don't understand what you mean...

Back to Top
Bliss View Drop Down
Groupie
Groupie
Avatar

Joined: 25 April 2003
Location: United States
Status: Offline
Points: 181
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bliss Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2003 at 10:21am

If you use Farrukh's way, the skin will be reset every time. Just do

If user_skin NOT = "" Then

SQL_set_skin="SELECT table_skin.* FROM table_skin WHERE skin_name='" default "';"

Else

SQL_set_skin="SELECT table_skin.* FROM table_skin WHERE skin_name='" & user_skin & "';"

End If

Hehehe...
Back to Top
Aumuz View Drop Down
Groupie
Groupie
Avatar

Joined: 14 March 2003
Location: United States
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aumuz Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2003 at 10:29am

I already knew this... This has nothing to do with my question.

What I want to do is place all my SQL's in the config.asp.

I was only using the skin as a example of a problem... That problem being a value of the SQL being set after the config.asp.

A default skin has nothing to do with my question.

Back to Top
Aumuz View Drop Down
Groupie
Groupie
Avatar

Joined: 14 March 2003
Location: United States
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aumuz Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2003 at 12:56pm

Solved my problem...

config.asp

<%

sub user_SQL()

 SQL_set_skin="SELECT table_skin.* FROM table_skin WHERE skin_name='" & user_skin & "';"

 OTHERSQLS

end sub

%>

skin.asp

<%

call user_SQL()

site_reocrd.open SQL_set_skin, site_data

%>

It works well but is there a better way of doing it?

Back to Top
Aumuz View Drop Down
Groupie
Groupie
Avatar

Joined: 14 March 2003
Location: United States
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aumuz Quote  Post ReplyReply Direct Link To This Post Posted: 22 August 2003 at 10:13pm

Ok, I found a even better way...

<%

function call_SQL(text)

select case text
 case "skin" call_SQL="SELECT table_skin.* FROM table_skin WHERE skin_name='" & user_skin & "';"end select

end function

%>

<% record.open call_SQL("skin"), data %>

This makes thing a bit cleaner.

Again, if anyone can help me improve this code... I would love the help.

Thanks.

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.