Jump to content

Display 1 to 100


Hasti

Recommended Posts

Hello

      I want to display value from 1 to 100

     

      Result

----------------------

    fieldname

---------------------

        1

        2

        .

        .

      100

 

This way i want to display using select query...

 

Link to comment
https://forums.phpfreaks.com/topic/171134-display-1-to-100/#findComment-902466
Share on other sites

Ok Lets forget it.

    What i need is this.. suppose for example, a X table contain 10 rows in table with primary key as auto increment. now suppose i deleted the 4th row than now i want to use that deleted auto increment key  for new record insertion. Through query only without using php code.

 

Link to comment
https://forums.phpfreaks.com/topic/171134-display-1-to-100/#findComment-902480
Share on other sites

Hi

 

While I agree that you shouldn't insert into an auto increment field, you can get a range of numbers.

 

Have a table (say call it integer) with a single column called i, with 10 rows of 0 to 9.

 

You can get the numbers 0 to 9 by doing SELECT i FROM integer.

 

To get 0 to 99 do SELECT a.i*10+b.i FROM integer a, integer b

 

So to get 40 to 80:-

 

SELECT *

FROM (SELECT a.i*10+b.i as SomeNumber FROM integer a, integer b)

WHERE SomeNumber BETWEEN 40 and 80

 

All the best

 

Keith

Link to comment
https://forums.phpfreaks.com/topic/171134-display-1-to-100/#findComment-902495
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.