[PHP-DB] How to install PHP-DEV package for PDO_OCI
Hi guru, Hope some kind souls out there can help me out here...I've successfully compile Apache2.2; PHP 5.16 on a Fedora 4 (with the Oracle instant client) machine...My connection to the remote Oracle database is working fine using OCI_CONNECT. My next step is to try out PDO. When I do a "php -m", I didn't see the PDO_OCI module. Hence I downloaded the PDO_OCI-1.0.tgz file and do a pear install. But it comes out an error "ERROR: `phpize' failed". Then I found out that phpize error is because the PHP-DEV package is not install. The problem puzzle me is how do I install PHP5-DEV into my current setup?? I do a Google and can't find any PHP5-DEV package for Fedora4 PHP5.1.6... Any help will be greatly appreciated here... Below is some of the output from my machine: [EMAIL PROTECTED] dbtest]# pear install PDO_OCI-1.0.tgz 7 source files, building running: phpize Configuring for: PHP Api Version: 20041225 Zend Module Api No: 20050922 Zend Extension Api No: 220051025 ERROR: `phpize' failed [EMAIL PROTECTED] dbtest]# php -v PHP 5.1.6 (cli) (built: Sep 14 2006 12:23:31) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies [EMAIL PROTECTED] dbtest]# php -m [PHP Modules] ctype date dom hash iconv libxml oci8 pcre PDO posix Reflection session SimpleXML SPL SQLite standard tokenizer xml xmlreader xmlwriter zlib [Zend Modules] Thanks a million in advance... Choy
Re: [PHP-DB] Help displaying Column Names
On 9/14/06, Miguel Guirao <[EMAIL PROTECTED]> wrote: You haven't searched at all, go to www.php.net and look up for mysql_field_name() and related functions!! -Original Message- From: Grant Griffith [mailto:[EMAIL PROTECTED] Sent: Jueves, 14 de Septiembre de 2006 10:22 a.m. To: php-db@lists.php.net Subject: [PHP-DB] Help displaying Column Names Hello All, I am fairly new to PHP but have coded in asp and asp.net for years. I am trying to find the code that will allow me to display the name of the column's from the table I am using. Below is the code where I am writing all the data out in a comma delimited fashion, but I want to make the very first row show the name of the database table names. For example I want to show the ID,Name,Address, etc... Can someone tell me what that command is in PHP? I have searched and can not find anything, I guess I am searching for the wrong info as I know it can be done!!! This functionality is related to the database you are using. Thus you have to look into the functions that PHP provides for this database. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: tsearch2, PHP5 with Bidi + US-ASCII
Am 2006-09-11 10:40:06, schrieb Chris: > Michelle Konzack wrote: > >Am 2006-09-08 06:53:10, schrieb Chris: > > > >>You're using postgres aren't you ? If you copy/paste the query and run > > > >Yes ;-) > > considering tsearch was in the subject that was rather a silly question > wasn't it ;) > > >>it through psql do you get results? > > > >This is what I have already tried... and WHY I do not find the error. > > So you do get results running the query through psql but not through php? Yes. I have tested following: 1) Text to search has ONLY RTL language (farsi, arabic, hebrew) and search string is RTL. - Works perfectly using pgadmin and then a UNICODE Terminal with psql. 2) Text to search has ONLY RTL AND LTR language (e.g. farsi + german) and search string is RTL. - Works perfectly using pgadmin and then a UNICODE Terminal with psql. 3) Text to search has ONLY RTL AND LTR language (e.g. farsi + german) and search string is RTL AND LTR. - Failed on both pgadmin and psql. Then I have echoed the SELECT string from PHP5 into a RTL capable UNICODE viewer and all is shown right. This let my brain smoking... since I need this Type of search. If you search things like this in Google it works perfectly! Maybe Google IS God! Greetings Michelle Konzack Systemadministrator Tamay Dogan Network Debian GNU/Linux Consultant -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # Michelle Konzack Apt. 917 ICQ #328449886 50, rue de Soultz MSM LinuxMichi 0033/6/6192519367100 Strasbourg/France IRC #Debian (irc.icq.com) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Displaying a PDF file
At 09:33 AM 9/14/2006, Ron Piggott (PHP) wrote: I am creating a submit button on the fly. The purpose of this is to open up a new browser window and then display the contents of a PDF file. The code for this button reads: The window name is prayer_ministry_document_viewer I am trying to access document_reference 1 which is in a mySQL table. mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM prayer_ministry_documents WHERE reference = '$document_reference'"; $document_result=mysql_query($query); mysql_close(); $document_file_name = mysql_result($document_result,0,"document_file_name"); #now here I start to get the contents of the PDF file to display $lineArray = file($document_file_name); // make an empty variable first $document_contents_to_display = ""; // concat all array element foreach($lineArray as $eachLine) { $eachLine = wordwrap($eachLine); $document_contents_to_display .= $eachLine; } #when I try to display it the PDF it displays it as text with the various ASCII characters --- #what I am doing wrong / what is the correct way to do this #I know I could simply specify the file name / path following the window.open ... but I am trying to see if I am able to accomplish the same results this way. echo $document_contents_to_display; ?> Ron So Ron, why not just ... as the action triggered on the button. (Unless you're storing the .pdf in the database.) Miles -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.12.3/447 - Release Date: 9/13/2006 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Help displaying Column Names
You haven't searched at all, go to www.php.net and look up for mysql_field_name() and related functions!! -Original Message- From: Grant Griffith [mailto:[EMAIL PROTECTED] Sent: Jueves, 14 de Septiembre de 2006 10:22 a.m. To: php-db@lists.php.net Subject: [PHP-DB] Help displaying Column Names Hello All, I am fairly new to PHP but have coded in asp and asp.net for years. I am trying to find the code that will allow me to display the name of the column's from the table I am using. Below is the code where I am writing all the data out in a comma delimited fashion, but I want to make the very first row show the name of the database table names. For example I want to show the ID,Name,Address, etc... Can someone tell me what that command is in PHP? I have searched and can not find anything, I guess I am searching for the wrong info as I know it can be done!!! $sel_result = mysql_query("select * from customerdata where account_type = '$tmpType'",$db); //Now loop thru account types and show the one selected while($sel_row=mysql_fetch_array($sel_result)) { print "\"$sel_row[0]\",\"$sel_row[1]\",\"$sel_row[2]\",\"$sel_row[3]\",\"$sel_ row[4]\",\"$sel_row[5]\",\"$sel_row[6]\",\"$sel_row[7]\",\"$sel_row[8]\" ,\"$sel_row[9]\","; print "\"$sel_row[10]\",\"$sel_row[11]\",\"$sel_row[12]\",\"$sel_row[13]\",\"$ sel_row[14]\",\"$sel_row[15]\",\"$sel_row[16]\",\"$sel_row[17]\",\"$sel_ row[18]\",\"$sel_row[19]\","; print "\"$sel_row[20]\",\"$sel_row[21]\",\"$sel_row[22]\",\"$sel_row[23]\",\"$ sel_row[24]\",\"$sel_row[25]\",\"$sel_row[26]\",\"$sel_row[27]\"\n"; } Thanks, Grant Griffith Web Application Developer Enhanced Telecommunications http://www.etczone.com 812-932-1000 Este mensaje es exclusivamente para el uso de la persona o entidad a quien esta dirigido; contiene informacion estrictamente confidencial y legalmente protegida, cuya divulgacion es sancionada por la ley. Si el lector de este mensaje no es a quien esta dirigido, ni se trata del empleado o agente responsable de esta informacion, se le notifica por medio del presente, que su reproduccion y distribucion, esta estrictamente prohibida. Si Usted recibio este comunicado por error, favor de notificarlo inmediatamente al remitente y destruir el mensaje. Todas las opiniones contenidas en este mail son propias del autor del mensaje y no necesariamente coinciden con las de Radiomovil Dipsa, S.A. de C.V. o alguna de sus empresas controladas, controladoras, afiliadas y subsidiarias. Este mensaje intencionalmente no contiene acentos. This message is for the sole use of the person or entity to whom it is being sent. Therefore, it contains strictly confidential and legally protected material whose disclosure is subject to penalty by law. If the person reading this message is not the one to whom it is being sent and/or is not an employee or the responsible agent for this information, this person is herein notified that any unauthorized dissemination, distribution or copying of the materials included in this facsimile is strictly prohibited. If you received this document by mistake please notify immediately to the subscriber and destroy the message. Any opinions contained in this e-mail are those of the author of the message and do not necessarily coincide with those of Radiomovil Dipsa, S.A. de C.V. or any of its control, controlled, affiliates and subsidiaries companies. No part of this message or attachments may be used or reproduced in any manner whatsoever. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Help displaying Column Names
Hello All, I am fairly new to PHP but have coded in asp and asp.net for years. I am trying to find the code that will allow me to display the name of the column's from the table I am using. Below is the code where I am writing all the data out in a comma delimited fashion, but I want to make the very first row show the name of the database table names. For example I want to show the ID,Name,Address, etc... Can someone tell me what that command is in PHP? I have searched and can not find anything, I guess I am searching for the wrong info as I know it can be done!!! $sel_result = mysql_query("select * from customerdata where account_type = '$tmpType'",$db); //Now loop thru account types and show the one selected while($sel_row=mysql_fetch_array($sel_result)) { print "\"$sel_row[0]\",\"$sel_row[1]\",\"$sel_row[2]\",\"$sel_row[3]\",\"$sel_ row[4]\",\"$sel_row[5]\",\"$sel_row[6]\",\"$sel_row[7]\",\"$sel_row[8]\" ,\"$sel_row[9]\","; print "\"$sel_row[10]\",\"$sel_row[11]\",\"$sel_row[12]\",\"$sel_row[13]\",\"$ sel_row[14]\",\"$sel_row[15]\",\"$sel_row[16]\",\"$sel_row[17]\",\"$sel_ row[18]\",\"$sel_row[19]\","; print "\"$sel_row[20]\",\"$sel_row[21]\",\"$sel_row[22]\",\"$sel_row[23]\",\"$ sel_row[24]\",\"$sel_row[25]\",\"$sel_row[26]\",\"$sel_row[27]\"\n"; } Thanks, Grant Griffith Web Application Developer Enhanced Telecommunications http://www.etczone.com 812-932-1000
[PHP-DB] local queries vs remote queries
hi, i'm looking for trouble-shooting pointers, particularly around how to debug query results on one host, i have a PHP reporting tool querying a PostGres back-end. Recently (i must have changed something ... but ... i don't remember even logging into this box recently, let alone changing anything), reports starting returning zero rows however, when i point the reporting front-end at another back-end host (the development box), the reports contain results. the results even look correct ;) when i run 'psql' on the production box and manually enter SELECT statements, i see results. those results look awfully similar to the results i see when i point my reporting front-end at the development box back-end ;) here's a window into my code: [...] echo "$sql"; # Query Soma $dbh = connect_db(); $q = query_db($dbh, $sql, $place); # Find metadata $num_hosts = $q->numRows(); DB::isError($q) and die ($q->getMessage()); echo "# of Records = $num_hosts"; # Generate and print the table generate_table($q); [...] function connect_db () { $dsn = 'pgsql://foo:[EMAIL PROTECTED]/soma'; $dbh = DB::connect($dsn, array('debug' => 1)); DB::isError($dbh) and die ($dbh->getMessage()); return $dbh; } function query_db ($dbh, $sql, $place) { $q = $dbh->query($sql, $place); DB::isError($q) and die ($q->getMessage()); return $q; } [...] when i perform a manual query via psql, i get results: soma=# SELECT mac, ip_addr, vlan, ad_ou, current_os_user, os_hostname, dns_hostname, version_name, snmp_sys_descr, snmp_sys_objectid, first_seen, last_seen, last_updated FROM hosts LEFT JOIN os_versions ON hosts.osver = os_versions.versionid WHERE last_seen > 2006-08-14 AND vlan = 74 ORDER BY ip_addr ASC; [...results...] but when i run a query using my PHP front-end, i don't. the debug output (echo stmts) to my browser looks like this: Querying Soma for Vlan = 74 WHERE Last_seen > 2006-08-14 SELECT mac, ip_addr, vlan, ad_ou, current_os_user, os_hostname, dns_hostname, version_name, snmp_sys_descr, snmp_sys_objectid, first_seen, last_seen, last_updated FROM hosts LEFT JOIN os_versions ON hosts.osver = os_versions.versionid WHERE last_seen > ? AND vlan = ? ORDER BY ip_addr ASC # of Records = 0 Zero records. No output. As though the database were empty. i've run a bunch of queries ... my reporting front-end allows me to produce a dozen or so reports ... and they all return 0 records ok, so i enabled postgres' statement logging capability in postgresql.conf: [...] log_statement = 'all' [...] here's what i see when i perform a manual 'psql' query: Sep 13 10:29:09 starsha postgres[24143]: [2-1] LOG: connection received: host=[local] Sep 13 10:29:09 starsha postgres[24143]: [3-1] LOG: connection authorized: user=foo database=soma Sep 13 10:29:31 starsha postgres[24143]: [4-1] LOG: statement: SELECT mac, ip_addr, vlan, ad_ou, current_os_user, os_hostname, dns_hostname, version_name, snmp_sys_descr, Sep 13 10:29:31 starsha postgres[24143]: [4-2] snmp_sys_objectid, first_seen, last_seen, last_updated FROM hosts LEFT JOIN os_versions ON hosts.osver = os_versions.versionid Sep 13 10:29:31 starsha postgres[24143]: [4-3] WHERE last_seen > 2006-08-14 AND vlan = 74 ORDER BY ip_addr ASC; Sep 13 10:29:32 starsha postgres[24143]: [5-1] LOG: duration: 93.679 ms Sep 13 10:29:53 starsha postgres[24143]: [6-1] LOG: disconnection: session time: 0:00:43.95 user=foo database=soma host=[local] and here's what i see when my PHP code performs the query: Sep 13 10:24:26 starsha postgres[24115]: [2-1] LOG: connection received: host=starsha.fhcrc.org port=50184 Sep 13 10:24:26 starsha postgres[24115]: [3-1] LOG: connection authorized: user=foo database=soma Sep 13 10:24:26 starsha postgres[24115]: [4-1] LOG: statement: SELECT mac, ip_addr, vlan, ad_ou, current_os_user, os_hostname, ^M Sep 13 10:24:26 starsha postgres[24115]: [4-2] dns_hostname, version_name, snmp_sys_descr, ^M Sep 13 10:24:26 starsha postgres[24115]: [4-3] snmp_sys_objectid, first_seen, last_seen, last_updated FROM hosts LEFT JOIN os_versions ON hosts.osver = Sep 13 10:24:26 starsha postgres[24115]: [4-4] os_versions.versionid WHERE last_seen > '2006-08-14' AND vlan = '74' ORDER BY ip_addr ASC Sep 13 10:24:26 starsha postgres[24115]: [5-1] LOG: duration: 34.641 ms Sep 13 10:24:26 starsha postgres[24115]: [6-1] LOG: disconnection: session time: 0:00:00.10 user=foo database=soma host=production.company.com port=50184 those '^M' look suspicious ... and so do the single quotes around 2006-08-14 and 74 ... when i try typing single quotes into a manual psql query, i get nothing in response. could this be a symptom of the problem? case 1: then, i turned to Wireshark (Ethereal's successor) to get another view of what is happening. for example, when i perform the manual psql query above, i have Wireshark sniffing on the local Ethernet interface, and i see the following packet trace https://vishnu.fhcrc.org/php-db/local-psql-works.pdf not
RE: [PHP-DB] Displaying a PDF file
I think you need to add a content-type of application/pdf to the code to tell the browser that its a pdf coming down // We'll be outputting a PDF header('Content-type: application/pdf'); Bastien From: "Ron Piggott (PHP)" <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: PHP DB Subject: [PHP-DB] Displaying a PDF file Date: Thu, 14 Sep 2006 08:33:45 -0400 I am creating a submit button on the fly. The purpose of this is to open up a new browser window and then display the contents of a PDF file. The code for this button reads: The window name is prayer_ministry_document_viewer I am trying to access document_reference 1 which is in a mySQL table. mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM prayer_ministry_documents WHERE reference = '$document_reference'"; $document_result=mysql_query($query); mysql_close(); $document_file_name = mysql_result($document_result,0,"document_file_name"); #now here I start to get the contents of the PDF file to display $lineArray = file($document_file_name); // make an empty variable first $document_contents_to_display = ""; // concat all array element foreach($lineArray as $eachLine) { $eachLine = wordwrap($eachLine); $document_contents_to_display .= $eachLine; } #when I try to display it the PDF it displays it as text with the various ASCII characters --- #what I am doing wrong / what is the correct way to do this #I know I could simply specify the file name / path following the window.open ... but I am trying to see if I am able to accomplish the same results this way. echo $document_contents_to_display; ?> Ron -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Displaying a PDF file
I am creating a submit button on the fly. The purpose of this is to open up a new browser window and then display the contents of a PDF file. The code for this button reads: The window name is prayer_ministry_document_viewer I am trying to access document_reference 1 which is in a mySQL table. mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM prayer_ministry_documents WHERE reference = '$document_reference'"; $document_result=mysql_query($query); mysql_close(); $document_file_name = mysql_result($document_result,0,"document_file_name"); #now here I start to get the contents of the PDF file to display $lineArray = file($document_file_name); // make an empty variable first $document_contents_to_display = ""; // concat all array element foreach($lineArray as $eachLine) { $eachLine = wordwrap($eachLine); $document_contents_to_display .= $eachLine; } #when I try to display it the PDF it displays it as text with the various ASCII characters --- #what I am doing wrong / what is the correct way to do this #I know I could simply specify the file name / path following the window.open ... but I am trying to see if I am able to accomplish the same results this way. echo $document_contents_to_display; ?> Ron