forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Variable content spanning multiple lines?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Raymond175
Contributor
Contributor


Joined: 24 Apr 2002
Posts: 72

PostPosted: Sat Aug 01, 2009 8:32 pm    Post subject: Variable content spanning multiple lines? Reply with quote

Hi there all,

I need to put a sql-query into a variable, but I do not want to put in all in one line.
What is the best way to span this on multiple lines?:
Code:
%%Query =
  SELECT d.domainname, e.extension, d.expiredate, r.registrar
  FROM domains d
  JOIN extensions e ON (e.id = d.extension_id)
  JOIN registrars r ON (r.id = d.registrar_id)
  ORDER BY d.expiredate ASC;

Thanks in advance,
Raymond
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sat Aug 01, 2009 9:47 pm    Post subject: Reply with quote

Code:
%%Query = "SELECT d.domainname, e.extension, d.expiredate, "
%%Query = %%Query"r.registrar FROM domains d JOIN extensions e ON (e.id = "
%%Query = %%Query"d.extension_id) JOIN registrars r ON (r.id = d.registrar_id)"
%%Query = %%Query"ORDER BY d.expiredate ASC;"


I'm not sure this is what you meant, but this is how you'd take one long line and and put into a variable in broken down pieces so that the data in the variable is still one long line, but just that you don't have to put it all in as one long line.

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Sun Aug 02, 2009 7:38 pm    Post subject: Reply with quote

You can also turn on the VDS editor word wrap. I have never liked the VDS editor for this reason. It makes it very difficult to read code that is longer than the IDE is wide. All I can say is whom ever idea it was to not allow lines of code to wrap to the next line was very short sited Laughing Razz It would have been nice if we could have had the IDE allow us to wrap lines like string assignments... It could have used a '~' to show that the line was wrapping of some other character like the '^'... Maybe a tool could be written that would allow you to wrap line but remove the wrap before you compile or run the code Idea
_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group