ober
-
Posts
5,327 -
Joined
-
Last visited
Posts posted by ober
-
-
Nevermind, I'm just going to use the 'dual' table to grab the nextval and then insert that value into the above.
-
You're basically just generating a series of forms. The first collects information about the database they want to use (will need to be setup already), and the next step would be just running the SQL queries to create the tables. Then you populate the tables with whatever information is necessary, including the login information they provide. Walking you through the entire process is kind of a lot to ask.
-
Call me stupid, but where is the echo? You're setting the value of the comparison to a variable. Is there more to the code?
-
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?
-
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).
-
http://www.php.net/manual/en/ref.pdo-oci.php
Are those '--with' directives only for compiling or can I put those references somewhere?
-
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.
-
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!
-
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.
-
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.
-
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.
-
That doesn't do anything. I've also tried Distinct on the object. No dice.
-
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:
SELECT object, MAX( IF(datatype='SCH','X','') ) AS 'SCH', MAX( IF(datatype='VV','X','') ) AS 'VV', MAX( IF(datatype='RS','X','') ) AS 'RS', MAX( IF(datatype='SP','X','') ) AS 'SP', MAX( IF(datatype='VL','X','') ) AS 'VL', MAX( IF(datatype='Blah','X','') ) AS 'Blah', MAX( IF(datatype='CT','X','') ) AS 'CT', MAX( IF(datatype='MltEdg','X','') ) AS 'MltEdg', MAX( IF(datatype='TW','X','') ) AS 'TW', MAX( IF(datatype='TG','X','') ) AS 'TG', MAX( IF(datatype='Argus','X','') ) AS 'Argus', MAX( IF(datatype='CS','X','') ) AS 'CS', MAX( IF(datatype='ND','X','') ) AS 'ND', MAX( IF(datatype='SIP','X','') ) AS 'SIP', MAX( IF(datatype='QVM','X','') ) AS 'QVM', MAX( IF(datatype='PR','X','') ) AS 'PR', MAX( IF(datatype='YF','X','') ) AS 'YF', MAX( IF(datatype='BC','X','') ) AS 'BC', MAX( IF(datatype='SC','X','') ) AS 'SC', MAX( IF(datatype='MS','X','') ) AS 'MS' FROM table WHERE datatype != 'sy' AND datatype != 'st' AND datatype != 'ry' GROUP BY object ORDER BY objectThe MAX/IF statement is for each 'type' mentioned above. Is there any way to do this without doing more looping and running more queries?
-
<?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.
-
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.
-
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.
-
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.
-
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.
-
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... :'(
-
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.
-
Can you show us more of the code?
-
-
OK, I wrote to C:\WINDOWS\Temp and it worked.... WTF.
-
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.
access an object in $_SESSION
in PHP Coding Help
Posted
I'm just trying to determine if the user is logged into a Joomla site and inside the Session, they have objects that hold the information. But how do I access those objects?
$_SESSION['__default'][$user->$username];
? Nothing I try seems to work.
Here is the structure of the dump from $_SESSION:
There is more to it but I need to access the stuff in the 'user' object.