MyUPB.com Discussion forums
You are not logged in. Please Register or Login.

Announcements

This project is not completely dead. I've just started work on localisation.
Please email me at clark@NOSPAMmyupb.com once you've registered so I can activate your account (remove "NOSPAM" from the email address)
~~~~ Clark


If you're getting a "Deprecated" error message, follow the instructions here

URGENT Security Patch for ≤ v2.2.6
A security hole has been discovered, follow the instructions and download the patch at the topic page.
Did the patch break your search page? Search Patch

Download myUPB
Version 2.2.7 Released - 24th December 2010


Pages (3): 3
Posted: Feb 19, 2007 1:09:15 am
Rebles



TextDB has a similar function called tdb::cleanUp(), try that.
--Jerroyd Moore
Bachelors of Science, Computer Science 2011
Jack Baskin School of Engineering
University of California, Santa Cruz

Posted: Feb 19, 2007 8:28:56 pm
tomilipin



Quote:
May I ask why you guys want to run the same query in the same script?

Because I don't know how to use cached query results (if it's possible). In my script, colors used in another script are listed. Some colors are used several times so my query (which is located in FOR loop) repeates.
I expected the same results but I got nothing instead...
As I wrote previously, $tdb->cleanUp() doesn't help.

Posted: Feb 19, 2007 10:59:24 pm
Clark



I can confirm this.

I just tested it out in my script.

Using $link->cleanUp() unsets the file pointers as I expect it's supposed to do, but resetting the file pointer to the same name immediately after cleanUp and then running the query again still yields a NULL result

Even using a different name in the setFP after the cleanUp() yields a NULL result
myUPB Developer

Posted: Feb 19, 2007 11:34:55 pm
Pilot



Quote:
Because I don't know how to use cached query results (if it's possible). In my script, colors used in another script are listed. Some colors are used several times so my query (which is located in FOR loop) repeates.
I expected the same results but I got nothing instead...
As I wrote previously, $tdb->cleanUp() doesn't help.



lets say you store your query in $query, why don't you just run a for loop twice with the same data instead of querying twice???
Tim Hoeppner

UPB Programmer
B. Sc. in Electrical Engineering

Posted: Feb 20, 2007 8:34:53 pm
tomilipin



Quote:
lets say you store your query in $query, why don't you just run a for loop twice with the same data instead of querying twice???

Well... I can't do that because I can't predict what colors will be used.
Lets say I've got a table with the following data
  • id:1, name:LegoBrick2x1, color:black.
  • id:2, name:LegoTile1x1, color:blue.
  • id:3, name:LegoWheel, color:gray.
  • id:4, name:LegoPlate, color:blue.

  • I print the records in FOR loop and also there I run query(). I just can't run that loop twice... I cannot even imagine how to cope with the results in that case!  But as you can see, I've got one color which appears twice. Records are displayed in the order they are stored in database so it's impossible to run FOR loop twice instead of querying twice;)
    I hope you undastand...
    I think I will prepare english version of my script interface and put it online so you can see it working :) Code will be available to view.

    Posted: Feb 20, 2007 9:13:28 pm
    tomilipin



    All right :) I've made it!

    Here is table of colors: www.legoshop.yoyo.pl/en/colors.php

    Here is table of bricks: www.legoshop.yoyo.pl/en/bricks.php

    If you want to look at the code, here's a ZIP archive of all files used in this example: www.legoshop.yoyo.pl/en/all.zip

    As I can see, it's working fine although the server is a bit slow... what can I expect from free hosting;)

    Posted: Feb 20, 2007 9:23:48 pm
    Rebles



    I dunno what it is, but it looks awesome!  How were you able to get around the NULL query return
    --Jerroyd Moore
    Bachelors of Science, Computer Science 2011
    Jack Baskin School of Engineering
    University of California, Santa Cruz

    Posted: Feb 20, 2007 9:32:04 pm
    codex



    the function empty? - Always a good function to use :D.
    IMLeeds www.imleeds.com Company search engine. Search with IMLeeds.

    Posted: Feb 21, 2007 2:53:07 am
    Pilot



    I think there talking about something else.
    Tim Hoeppner

    UPB Programmer
    B. Sc. in Electrical Engineering

    Posted: Feb 21, 2007 6:41:42 pm
    tomilipin



    Quote:
    I dunno what it is, but it looks awesome!  How were you able to get around the NULL query return

    Well... the source code is available to download here: http://www.legoshop.yoyo.pl/en/all.zip

    As I previously wrote, in my FOR loop I just run setFp at the beginning and run cleanUp at the end. That's the only working method of querying twice with the same results.

    Feel free to look at my code and tell me what am I doing wrong :)

    Pages (3): 3
    Powered by myUPB v2.2.6  ·   © PHP Outburst 2002 - 2013

    Creative Commons License