Jump to content

ramjosh

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Everything posted by ramjosh

  1. Our product is running on LAMP(PHP) architecture. For MySQL operation PDO library has been used. We are in the process of moving the product to a new Linux server. On the new server we are facing MySQL query output related issue. At the end of the post I have listed the server configuration details of both the servers and the sample PHP program with the output. It works fine in server 1 but when the same code moved to Server 2, the output is not correct. Would appreciate any points to solve this problem The following piece of code is tested and output is also given. <?php /*** mysql hostname ***/ $hostname = 'localhost'; /*** mysql username ***/ $username = 'ram'; /*** mysql password ***/ $password = 'tellmehow'; try { $dbh = new PDO("mysql:host=$hostname;dbname=inhouse", $username, $password); $sql = "SELECT first_name,last_name,user_id,email FROM users LIMIT 1"; $stmt = $dbh->prepare($sql,array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => TRUE)); $stmt->execute(); $result = $stmt->fetch(PDO::FETCH_OBJ); $stmt->closeCursor(); /*foreach($result as $key=>$val) { echo $key.' - '.$val.'<br />'; }*/ print_r($result); $dbh = null; } catch(PDOException $e) { echo $e->getMessage(); } ?> Output for server 1: stdClass Object ( [first_name] => super [last_name] => admin [user_id]=>1 => ram@greynium.com ) output for server 2: stdClass Object ( [first_name] => super [last_name] => admin [users] => ram@greynium.com ) On server 2 I am not getting the output for field 'user_id' from the table 'users'. For the field 'email' from 'users' table, it is displaying the name of the table itself (users). Not sure what is wrong. The configuration of the servers are given below Server 1 -------- OS Details: Linux 2.6.9-5.ELsmp PHP Details: PHP 5.2.3 (cli) (built: Aug 28 2007 11:48:30) Copyright © 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright © 1998-2007 Zend Technologies with Suhosin v0.9.22, Copyright © 2007, by SektionEins GmbH PDO details: PDO PDO support => enabled PDO drivers => sqlite2, sqlite, mysql PDO Driver for MySQL, client library version => 5.0.37 PDO Driver for SQLite 3.x => enabled Server 2 --------- OS Details: Linux 2.6.18-8.el5 PHP Details: eAccelerator requires Zend Engine API version 220060519. The Zend Engine API version 220090626 which is installed, is newer. Contact eAccelerator at http://eaccelerator.net for a later version of eAccelerator. PHP 5.3.2 (cli) (built: Jul 6 2010 17:57:31) Copyright © 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright © 1998-2010 Zend Technologies PDO Details: PDO PDO support => enabled PDO drivers => mysql, sqlite, sqlite2 PDO Driver for MySQL => enabled PDO Driver for SQLite 3.x => enabled
  2. Hi, I have generated HTML pages from XML files by applying XSL file using PHP. Ex: http://thatskannada.oneindia.in/news/2009/04/05/ls-election-who-will-win-in-karnataka.html These are unicode bases files. When I go to view source of this page I wont be able to see the line breaks. Actually these line breaks helps me to see meta title and description properly. Currently these are in the same line. Like, <title>Lok Sabha Election 2009 | BJP | Congress | JDS | Karnataka - ಲೋಕಸಭೆ: ಕರ್ನಾಟಕದಲ್ಲಿ ಗೆಲ್ಲುವ ಕುದುರೆಗಳು - Oneindia Kannada</title><meta name="title" content="ಲೋಕಸಭೆ: ಕರ್ನಾಟಕದಲ್ಲಿ ಗೆಲ್ಲುವ ಕುದುರೆಗಳು "></meta>................ I want to have proper line breaks. The following is the XSL piece of code. <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:php="http://php.net/xsl" xmlns:date="http://exslt.org/dates-and-times" extension-element-prefixes="date" exclude-result-prefixes= "php"> <xsl:output method="html" indent="yes" doctype-public ="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" /> <head> <title><xsl:value-of select="Data/title"/> - Oneindia Kannada</title> <meta name="title"><xsl:attribute name="content"><xsl:value-of select="Data/headline" /></xsl:attribute></meta> <meta name="Generator" content="Greynium CMS" /> <meta http-equiv="content-language" content="ta" /> <meta name="robots" content="index, follow" /> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Cache-Control" content="no-cache" /> <meta content="document" name="resource-type" /> <meta content="global" name="distribution" /> <meta name="rating" content="General" /> <meta name="Description"> <xsl:attribute name="content"><xsl:value-of select="Data/description"/></xsl:attribute></meta> <meta name="Keywords"><xsl:attribute name="content"><xsl:value-of select="Data/keywords"/></xsl:attribute></meta> .......................... Can anybody help me in giving line breaks for the view source? I tried with \n\r in different way but nothing happend.
×
×
  • 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.