ober
-
Posts
5,327 -
Joined
-
Last visited
Posts posted by ober
-
-
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. -
Templates would be the preferred option in most if not all cases.
-
Just FYI, your database is very poorly designed. You need to look up normalization and split that stuff into multiple tables.
-
You must save the file with a PHP extension unless your PHP installation is configured to parse html pages.
-
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. -
You're going to have to explain yourself a little better. What are you trying to achieve? And if your crawler is smart enough to submit forms, you can certainly crawl whatever is past the authentication.
-
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. -
I'd suggest using AJAX. And I don't see the problem with using POST arrays. If your issue is using links vs. buttons to move to the next page, you can call a javascript submit through the link.
-
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. -
Well, I can see one major problem right off the bat. Your WHERE clause in the SQL statement must come AFTER the SET clause.
-
Spend some time with this website... hopefully it'll help you: [a href=\"http://www.regular-expressions.net/\" target=\"_blank\"]http://www.regular-expressions.net/[/a]
-
Not that I'm aware of. You'll have to write your own.
-
PHP is a SERVER SIDE SCRIPTING LANGUAGE. That means that any sound you want to play, or layout problems you may have must be handled by either HTML, CSS, or Javascript.
-
date("h:i A", strtotime($record['date_column']))
Look up the date function in the manual for variations of the date formatting. -
Functions normally only return one item. However, I believe you could return an array of items.
You may also want to look into a class for returning multiple items. -
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. -
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.
-
No, that means you don't have a column in that table called "select_type".
-
You're missing a closing single quotation mark after $pets_allowed.
-
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). -
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. -
I checked out the server last night... 31/32 players. I wasn't a huge fan of the map, so I went and played some Euro Forces instead. Good to know it's an active server however!
-
Oddly enough, it doesn't show the changes there either.
-
Weird... must be the proxy here at work, but I'm not getting any of these updates.
Navigation Submenu in column
in CSS Help
Posted