Jump to content

ober

Staff Alumni
  • Posts

    5,327
  • Joined

  • Last visited

Posts posted by ober

  1. So I have a project where I'm graphing 2 recordsets against each other, and each recordset contains 12000 records. I first pull the data out of a database and dump it into arrays, then I feed those arrays to the graphing function. The users have the option to graph up to 5 channels (columns of data) at a time, so before I was checking to see if the channel was selected and then adding a value to that specific array.

    What I've done (and I've run the timing numbers and it is faster) is to calculate the total number of channels that have been selected and us a switch without breaks to figure out how many I have to fill:
    [code]    if($result && mssql_num_rows($result) > 0)
        {
            $d0 = array();
            $d1 = array();
            $d2 = array();
            $d3 = array();
            $d4 = array();
            while($row = mssql_fetch_array($result))
            {  
                switch($fldcnt)
                {
                    case 5:
                        $d4[] = $row[5];
                    case 4:
                        $d3[] = $row[4];
                    case 3:
                        $d2[] = $row[3];
                    case 2:
                        $d1[] = $row[2];
                    case 1:
                        $d0[] = $row[1];
                    break;
                }
            }
        }
        else
        {
            $t1ok = false;
            echo '<br/><br/><p class="warn">There is no 10Hz data for test 1.</p>';
        }
    [/code]

    I guess I'm just curious if someone would have a better way to do this, as I think I've come up with the best solution.
  2. There's not going to be an easy way to do this unless you can programatically grab the information out of the PDF and stuff it into a database. You're still going to have to go through the content and do formatting and so on. My suggestion is to create a table for "topics" or "products" or whatever you want to call them. Put the content for each item in a seperate record and then create one page that pulls the correct information out of the database. If the layout for each item is similar, you can leave most of the formatting to the one PHP page and seperate your product content into various fields (item number, serial number, description, etc) and format it as you pull it out of the database.

    I don't know what you're looking for as far as a specific answer, so I hope that helps.
  3. That's kind of a poor way to go about it. All you have to do is check to see if the reference is in the database already and if it is, just run an update:
    UPDATE misc SET hits = hits + 1 WHERE ref = 'whatever'; <-- literally like that except for changing the "whatever" variable

    If it's not already in the table, you'll want to do insert a new record.
  4. Just in case anyone else ever digs this thread back up or searches for it, I did find an answer:

    [a href=\"http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=850&lngWId=5\" target=\"_blank\"]http://www.planet-source-code.com/vb/scrip...Id=850&lngWId=5[/a]

    I modified it to fit my application and it works like a charm. Obviously it's very bloated compared to the LIMIT clause, but it works.
  5. I'm not sure why you think these files are loaded into RAM when you're uploading them. I'm not 100% sure, but I don't think that's the case.

    To answer some of the other questions, I don't think it's ever a good idea to store images in a database. It's a DATAbase... not a FILEbase. Data meaning text and small binary strings, not large chunks of images and random files.

    I personally wouldn't bother encoding the files. Let the user deal with that.

    Progress bars are very possible. Consider using something like AJAX to accomplish that.

    And I would definately consider using the PHP FTP functions instead of the normal upload functions.
  6. Put the ones it has come up with in an array. If it comes up with that same number again, redo your randomizing before moving on to the next match. You can use in_array() to see if the new random number is in your "used" array.
  7. I know you can use the LIMIT clause in MySQL to grab a specific group of records from a MySQL table, but I'm using MSSQL and I need to do the same thing. I know about the TOP function, but I'm not sure how to go about grabbing the TOP x records starting at record y.

    I have groups of 12000+ records in a table and I'm graphing all the records. They will have the option to zoom in on the graph and I need to be able to go back and grab from x to y.

    Any ideas? The only other thing I was thinking of was doing some math on the ID value (auto-increment).
  8. Make sure you've done this:
    The extension requires the MS SQL Client Tools to be installed on the system where PHP is installed. The Client Tools can be installed from the MS SQL Server CD or by copying ntwdblib.dll from \winnt\system32 on the server to \winnt\system32 on the PHP box. Copying ntwdblib.dll will only provide access. Configuration of the client will require installation of all the tools.
×
×
  • 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.