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
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....

Link to comment
Share on other sites

$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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.