Jump to content

Recommended Posts

I am trying to navigate trough a table using SQL. I created a diagram that displays mulitple steps in a process located here (http://www.pixelfxmedia.com/steps.php) what i am trying to achieve it to go from step 1-2 to 1.3 using a dynamic hyperlink so in the end i'll probably have http://www.pixelfxmedia.com/steps.php?step=1-3

 

I currently have the statement

$Query1a =	"SELECT * FROM STEPS WHERE STEPNO = ".steps."; ";

which returns the record for row 3 in my table (step 1-2). what i want to do is see if there is a record after 1-2 if there is then i display the link http://www.pixelfxmedia.com/steps.php?step=1-3  where 1-3 is the value of the next record  if not then i just echo a message saying there is no more steps.

 

I know i don't explain things too well but please work with me

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/142118-geting-the-next-record-in-sql/
Share on other sites

is there a way to get the row number? lets say we have  3 results from a a query

query 1

-------

1. bob

2. Lisa

3. Amy

 

lest say i want to find out what row number lisa is in my array

is there sort of a

Get rowNumber where Name = Lisa

so then after that i can just set that value to a variable

$numb = the row number +1

and then run something like

get name where rowNumber = $numb

then get that name value and store it to a varialbe

after that do file.php?=name

 

thats the gist of what i'm trying to do. this way i can trying to do

lest say i want to find out what row number lisa is in my array

is there sort of a

Get rowNumber where Name = Lisa

You could take a look at PHPLinq, which is a PHP implementation of C#3.0's LINQ (Language Integrated Query)

 

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.