Jump to content

Make Query start at 1 and not 0


AE117

Recommended Posts

So as everyone knows when you make a Query Select From Where etc.. the results pull in a list as such

 

0 - result 1

 

1 - result 2

 

ect...

 

Is there a way to make the results start at 1??

 

And no this is not a problem with Auto Increament in a Table. I need the actually query to start at 1. Thank You

Link to comment
https://forums.phpfreaks.com/topic/175752-make-query-start-at-1-and-not-0/
Share on other sites

because there is a code I wrote that starts only at 1 because it can not see 0 as a real integer so it will ignore it.

 

Hence everything that it sees starts at one and any code that interacts with this particular set also needs to start at 1. Yes I know, but the other code only works if it starts at 1.

 

I cant even think of a work around for it if starting at 1 isnt a possibility....

$yourFilledArray[] = "blank entry";
for($i=0;$i    $yourFilledArray[$i] = $i++;
array_shift($yourFilledArray);

could work.

 

EDIT: scratch that.

 

EDIT2:Ok..I've done my good deed for the day

$someArray = range(1, 100);
function PushDownArray(&$row) {
$row[] = null;
for($i=0;$i}
PushDownArray($someArray);
echo "",print_r($someArray),"";
?>

Executes in 0.0037 seconds

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.