Jump to content

inka

Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Transilvania

inka's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello. I am trying to connect my php page to an Oracle database, without success until now. I tried everything I could find on google, but nothing.... We have enabled oci8 in php: oci8 OCI8 Support enabled Version 1.4.7 Revision $Id: bf2eaf558b050b6d2e6d098bed6345af7e842ea4 $ Active Persistent Connections 0 Active Connections 0 Oracle Run-time Client Library Version 11.2.0.3.0 Oracle Instant Client Version 11.2 Temporary Lob support enabled Collections support enabled Directive Local Value Master Value oci8.connection_class no value no value oci8.default_prefetch 100 100 oci8.events Off Off oci8.max_persistent -1 -1 oci8.old_oci_close_semantics Off Off oci8.persistent_timeout -1 -1 oci8.ping_interval 60 60 oci8.privileged_connect Off Off oci8.statement_cache_size 20 20 I tried the following connection attempts - 3 versions (the server is not on the same machine as the oracle db): <?php //Putenv("NLS_LANG=SPANISH_SPAIN.WE8ISO8859P15"); $db="(DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP) (HOST=$GLOBALS[192.168.1.102])(PORT=$GLOBALS[1521]) ) ) (CONNECT_DATA=(SID=$GLOBALS[***])) )"; $conn = OCILogon($GLOBALS['user'],$GLOBALS['pass'],$db); if (!conn) { $e=oci_error(); trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR); echo $e; echo "dfsdf<br />"; return FALSE; } else echo "success"; return $conn; } /* $db='(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.102)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ***) ) )'; $connection = oci_connect('user', 'pass', $db); if (!$connection) { $e = oci_error(); echo htmlentities($e['message']); } */ ?> <?php /* function oracle_connect() { $user='user'; $pwd='pass'; $server='192.168.1.102'; // or ip $port='1521'; $sid='****'; // service name $charset='WE8ISO8859P1'; // change to whatever is needed $conn=oci_connect($user,$pwd,'//'.$server.':'.$port.'/'.$sid,$charset); if (!conn) { $e=oci_error(); trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR); echo $e; echo "dfsdf<br />"; return FALSE; } else echo "success"; return $conn; } $s = oci_parse($conn, "select * from 303"); */ ?> I get only a blank page! I`m not an IT guy but I can work well with PHP and MySQL...but Oracle gives me headaches... Any ideas? Anyone?!
  2. Thank you Pawn! It almost worked, but unfortunately the array key was not changed, was still 0-1-2 etc... But I managed to modify the $val to get the name I wanted. To sort the menu, I used ksort to sort the value not the key, but finally it worked, even its a very messy code Thanks again! Inka
  3. Greetings! I would like to ask for you help sorting a couple of lists that are autogenerated with php. The page reads a content of a folder and makes a menu from the names. The folder names are: a, b, c, d... etc. The other part reads the content of the selected folder and displays the files. My problem is, that on windows, using xampp, the both the folders and files appear in alphabetic order (what I want), but on the linux server they get completely messed up. Instead of a, b, its o, a, d, etc. I tried using the sort() function but there is no array to sort... Thank you for any suggestions and help! Inka ps. the server has php 4.3.9... does this matter? could help if we upgrade to 5.3? here is the code: <?php $dh = opendir($dir); while (false !== ($filename = readdir($dh))) { $files[] = $filename; if ($filename != "." && $filename != "..") { if($_SERVER['REQUEST_URI'] == "index.php?l=" . $filename . '&sec=' . $sec){ echo '<td><img src="imagini/arow.gif"></td><td style="text-align: left;">' . strtoupper($filename) . $space; } else { echo '<td style="text-align: left;"><a href="index.php?l='. $filename . '&sec=' . $sec . '">' . strtoupper($filename) . $space; }}} ?> <?php $letter = "a"; if(isset($_GET["l"])){ $letter = $_GET["l"];} $letter = $dir . $letter; if ($handle = opendir($letter)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $filename = $file; $file2 = substr($filename, 0, -4); $thelist .= '<tr><td style="width: 250px; text-align: left;"><a href="'. $letter . '/'. $file.'">'.$file2.'</a></td></tr>'; } } closedir($handle); } ?> <p><?php echo $thelist; ?></p>
  4. Greetings! I`m very newbie to php programing, so please do not laugh if I ask stupid questions. I`m trying currently to make a book catalog and I don`t really know how to realise some searches. First of all, is it possible to search with php in MySQL wih wildcards like *? My other problem would be that I need to introduce a sequence of numbers to a book, the numbers are continuous so I dont want to introduce them all only the first and last number. Is it possible to store in the DB all the numbers between and make the searchable? Example: numbers are 1100-1150, but I need this result also for 1122. Last question would be about keywords, if anyone has some tips how the introduce them to be easily searchable. Thank you very much for you answer! Regards, Inka
×
×
  • 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.