In message <[EMAIL PROTECTED]>, Wade <[EMAIL PROTECTED]>
writes
>
>04192005 1013 GMT-6
>
>Ok. Im working on this site and there is this very long application.
>Once you submit that, I have created a 'viewer' for the owner of the
>site to review those apps. Apps can be held for a long time. Some are
>rejected. When filled, they are removed - just like the rejected ones.
>
>The owner wants to see all apps, starting with the first one. Now, I
>thought about sorting by date, but, because the apps can be updated, the
>date changes with every update. So, I went with the appid. Its
>sequential - just like the owner wants it to be.
So how does the user see the information when the program starts? All
the apps in a table? (what is an app? application to join?). It
sounds as though he just gets one on screen, deals with it, then presses
the [next page] button.
>
>I would start at the first one and go on to next and so on.
>
>Now, you have to know that I do not have access to make changes to the
>db. I have suggested it time and again but the owner wants it a certain
>way.
>
>If you have a better suggestion - PLEASE tell me.
>
>Here is a piece of code from another list. It worked for one guy but Im
>having difficulty with it.
This is the bit you keep coming back to, and I can't see why. Here, you
say, show me the one before I just viewed,
>
>$q1 = "SELECT Max(clrId ) As prev from tblcolorpattern Where clrId <
>$id";
>$res = mysql_query($q1);
>if($res)
>{
> $num = mysql_num_rows($res);
> if($num)
> {
> $prev = mysql_result($res,0,0);
> }
>}
>
>this code give me id before the current id in DB
>
>/************************************************/
>
>$q2 = "SELECT Min(clrId ) As next from tblcolorpattern Where clrId >
>$id";
>$res = mysql_query($q2);
>if($res)
>{
> $num = mysql_num_rows($res);
> if($num)
> {
> $next = mysql_result($res,0,0);
> }
>}
>this code give me id after the current id in DB
>
>I rewrote it so I could better understand it:
>
>$sql = "SELECT MAX(appid) AS prev from application WHERE appid < =
>'".$appid."'";
>
>$result = mysql_query($sql);
>
>if ($result) {
> $num = mysql_num_rows($result);
> if ($num) {
> $prev = mysql_result($result, 0, 0);
> }
>}
>
>I must have misunderstood how to use it.
What do you get? Error message? Blank screen? Wrong record?
>
>Wade
--
Pete Clark
http://www.hotcosta.com
http://www.spanishholidaybookings.com
The PHP_mySQL group is dedicated to learn more about the PHP_mySQL web database
possibilities through group learning.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php_mysql/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/