Jump to content


Staff Alumni
  • Posts

  • Joined

  • Last visited

Everything posted by ober

  1. I'm using the PHPActiveRecord ORM and trying to create a basic query and I would have this same problem if I was writing direct SQL. How do I pass a database function to a query and have it be parsed correctly? $trail = new AuditTrail(); $trail->aid = "TABLESEQ.nextval"; $trail->uname = $usr; $trail->adatetime = date("n/j/Y h:i:s A"); $trail->acat = $cat; $trail->aaction = $action; $trail->contract_id = $contract; $trail->save(); The 'TABLESEQ.nextval' is an Oracle database 'autonumber' type functionality. I tried doing it with single quotes, double quotes, no quotes. How do I get it to recognize it as a DB function? The SQL query would look like: "INSERT INTO TABLE (aid, uname, adatetime, acat, aaction, contract_id) VALUES (TABLESEQ.nextval, '$usr', '".date(n/j/Y h:i:s A)."', '$cat', '$action', '$contract')" Any ideas what I'm doing wrong?
  2. Ok, got it figured out. I swear I added the path to the oracle instant client to the windows PATH previously but I guess not. So here are the steps needed if anyone else needs to do this on Windows: 1) Follow this tutorial with the latest versions of Apache/PHP: http://www.vertstudios.com/blog/php-apache-installation-tutorial/ 2) Follow the notes here: http://www.oracle.com/technetwork/articles/technote-php-instant-084410.html, specifically this section: Enabling the PHP OCI8 Extension on Windows 3) Make sure the OCI8 and the PDO OCI extensions are enabled in PHP. 4) Profit (or something).
  3. http://www.php.net/manual/en/ref.pdo-oci.php Are those '--with' directives only for compiling or can I put those references somewhere?
  4. Yes, sorry. Windows 7 Ultimate 32 bit. Yes, all of the DLLs are in place in the extension folder. I did the manual installation of PHP so everything is there.
  5. I am trying to get Apache 2.2 and PHP 5.3.6 up and going and connected to an Oracle database. I have Apache and PHP playing nicely at this point. My problem is the PDO driver for Oracle. I've uncommented the php_pdo_oci extension in php.ini and it seems to be adding it in after an Apache restart but the driver isn't there. The weird part is that this is in the configure command in phpinfo: "--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared" " Those paths don't even exist. I don't even have a D drive. I think maybe if I could change those it would work. OH, and I'm trying to use PHPActiveRecord, which only has a PDO extension for Oracle... which is why I'm trying to get PDO working. But when I go to a page that actually calls for a connection using PDO, it just says that it can't find the driver. Can anyone help me?? I've been stuck on this for 2 days!
  6. ober

    Query issue

    OK, so replacing all newline characters in the data in the database cleared the problem, so I just did that and now I'm replacing them as they're imported as well. Problem solved.
  7. ober

    Query issue

    So if I do this: SELECT object, HEX(object) FROM table The duplicates are being caused by an additional '0D' on the objects that are otherwise similar. Now I have to figure out how to strip those. I don't think it's necessarily an encoding thing anymore.
  8. ober

    Query issue

    OK, it's not a problem with the query. If I select two rows from the same object and do nothing but save them, it updates the name of the object on one of them and the output magically works again. So now I'm wondering if the problem is an encoding problem? That column is current set to a collation of latin1_swedish_c1. Should I change it? The data is coming from 2 different sources so it is possible that the encoding on one of them could be different.
  9. ober

    Query issue

    That doesn't do anything. I've also tried Distinct on the object. No dice.
  10. ober

    Query issue

    I have data stored like this: object1 | typeA object1 | typeB object2 | typeA etc. I want the output to be as follows: typeA | typeB object1 X | X object2 X Instead, I'm getting: typeA | typeB object1 X | object1 | X object2 X My query is as follows: The MAX/IF statement is for each 'type' mentioned above. Is there any way to do this without doing more looping and running more queries?
  11. <?php header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate'); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past header('Pragma: no-cache'); header('Cache-Control: private',false); header('Content-Type: binary'); // plain text file $filename = 'test.dat'; header("Content-Disposition: attachment; filename=\"".$filename."\";" ); header("Content-Length: ".filesize($filename)); readfile("$filename"); ?> Well, I wrote the results to a .dat file and now it is serving it appropriately. WEIRD. Oh well, all is well that ends well.
  12. OK, it gets even more weird. I can create an xlsx file in another directory and I can create a .dat file in this directory, but now the .dat file gets served as an empty file, even though I can see it and there is definitely data in it.
  13. Nope, IIS. And here's the weird thing. When I browse on the server and go to the properties of the folder, the 'read only' checkbox is 'half-checked', if you know what I mean. I uncheck it, hit ok, come back in and it's back to 'half-checked'... like I never touched it. But the weird thing is, the temp folder where I was able to write to also has the same setting.
  14. Start with this: http://www.phpfreaks.com/forums/index.php/topic,95441.0.html And in the while loop, you need to do one of 2 things: 1) Add all users to an array or comma separated string to use in the mail() function 2) mail each recipient separately in the while loop. I would send one email to all recipients, personally... and make sure you BCC them.
  15. Well, that's what it is doing now... using the windows temp folder because I seem to have a permission problem somewhere that is not allowing me to write to anything in the DOCUMENT_ROOT.
  16. I can't do that because the file isn't in the web server's path. I'm actually grabbing it from outside of the public access. So I have to be able to do this. I guess my other option would be to copy it to another location after processing it, but it seems to be insane that this isn't possible. It works great in FF... :'(
  17. I am generating a snapshot of some data and giving the users the ability to download that snapshot. I am trying to serve that file to the users and it works great in Firefox, but the IE users just get a blank file. I'm using the following: <?php header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate'); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past header('Pragma: no-cache'); header('Content-Type: text/plain; charset=ISO-8859-1'); // plain text file $filename = 'C:\WINDOWS\Temp\snapshot.txt'; header("Content-Disposition: attachment; filename=\"".$filename."\";" ); header("Content-Length: ".filesize($filename)); readfile("$filename"); ?> I've changed multiple items several times and each works in FF, but none work in IE. Is anyone aware of any IE specific headers that need to be sent? It's just a plain text file, nothing fancy.
  18. ober


    http://www.php.net/manual/en/reserved.variables.server.php Look on that page for "Query String".
  19. OK, I wrote to C:\WINDOWS\Temp and it worked.... WTF.
  20. I tried in the document_root folder, I tried directly on the C drive... I keep getting the permission denied error. I've even checked the php.ini file to see if those functions were blocked.
  21. OK, so that worked... but the file isn't open. I even rebooted the server and it hasn't changed. I guess I'll try writing to another location.
  22. Pardon my ignorance... but how do I do that?
  23. It's Windows Server 2003. And I'll say it again, this worked when I initially wrote it and the location of the file hasn't changed and the server hasn't changed. And it's not read-only (the file). And the user (as far as the webserver) hasn't changed either.
  24. The file isn't read only... so what else could it be??
  • 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.