loops

hierarchy loop mysql php

i want to display all users which are below my status. the lead_id shows my id if i'm the manager. all users when registering will have to put the person in charge id(lead-id) but in my case, i'm getting only users with my id. e.g id name leadid 1 xxx 0 2 aa 1 3 sdd ...

Custom loop not comparing metavalues properly

Hi so I have a custom loop that is supposed to show upcoming events only it's not taking into account the year so it's displaying future events as being in the past due to just the month and date. <ul class="upcoming"> <?php // Get today's date in the right format $todaysDate = date('m/d/y H:i:s'); ?> <?php query_posts('showposts=2&cat...

How to use setInterval or setTimeout with a for loop?

I am trying to set an interval when some code runs but only need to do it based on the number of elements there are. Here's a quick example: 5 total elements Run code once every 20 seconds for each element that is found. Can someone please give me a basic example how to do this using plain JavaScript? Everything I have tried just exec...

RewriteRule - loop redirection

Hello, i need help with this 2 rewrite rules: RewriteEngine On RewriteBase / # folder/script.php?A=1&B=2 -> xyz/1/2 (REDIRECT) RewriteCond %{QUERY_STRING} ^A=([^&]+)&B=([^&]+)$ RewriteRule ^folder\/script\.php$ /xyz/%1/%2? [R=301,L] # xyz/1/2 -> folder/script.php?A=1&B=2 (REWRITE) RewriteRule ^xyz\/([^\/]+)\/([^\/]+)$ /folder/scri...

foreach loop through database table .net c#

Hi guys, It's been a long day and I seem to have drawn a blank with my current issue. Below is code contained in my HomeController: public ActionResult About() { SqlDataReader rdr; string fileName = ""; const string connect = @"Server=localhost;Database=Images;user id=user; password=passwor...

Can you `break` from multiple loops like PHP can by passing a number?

If you are in a 3rd nested loop in PHP, you can do break 3; and break all loops up 3 levels. break seems to work in C. But if I do break 3 I get a syntax error. I guess it doesn't support it. What is the best way to break multiple loops? Should I set a flag which is checked up the loops - and breaks if it is set? Is there anything mor...

Help in Pascals triangle

The following code snippet prints the Pascals triangle,I have got this snippet from the internet but I am unable to get the formula for bin.If anyone can help me out with it I would be thankfull\ #include<stdio.h> int main() { int bin=1,p,q=0,r,x; clrscr(); printf("Rows you want to input:"); scanf("%d",&r); printf("\...

Multiple Loop Variables in For Statement in Obj-C

Is there a way to have multiple loop variables in a for statement? Here would be a hypothetical representation of what I'm talking about: for (NSString *foo in bar; NSString *bob in example) {} If not what is a good way to accomplish this? Thanks, Kolin ...

Loop constructing the URLs in a little parser-script: a seven liner needs some help!

howdy - good morning Community! i want to parse the site - and get the results out of it: see this URL here - a swiss-server - head over to this site where i want to loop over - see this page here - i want to access the sub-pages in order to get the information that is shown in the "detail-pages!" therefore i need to loop over the ...

Python Read and Output from Stdin Unbuffered

In C++ or any other languages, you can write programs that continuously take input lines from stdin and output the result after each line. Something like: while (true) { readline break if eof print process(line) } I can't seem to get this kind of behavior in Python because it buffers the output (i.e. no printing will happen ...