PHP detmine numbers in between two numbers then query

Posted by Joshua Anderson on Stack Overflow See other posts from Stack Overflow or by Joshua Anderson
Published on 2010-06-14T06:38:52Z Indexed on 2010/06/14 6:42 UTC
Read the original article Hit count: 366

Filed under:
|

This should be simple but I can't figure it out


<?php
$testid = 240;
$curid = 251;

$cal = $curid - $testid;
echo $cal;

?>

I want to determine the numbers in between two other numbers so for this example it detects there are 11 numbers in between the $testid and $curid, but i dont need it to do that.

I need it to literally figure the numbers in between $curid - $testid which in this example would be 241, 242, 243... all the way to 251 then i need to create a loop with those numbers and do a query below with each one

$cal = $curid - $testid;
mysql_query("SELECT * FROM wall WHERE id='".$cal."'")

// and for each number mysql should out put each data field with those numbers.

Thanks again, love you guys.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql