Comments for Mighty Webdeveloper http://www.mightywebdeveloper.com Webdevelopment Blog Sat, 14 May 2016 13:11:47 +0000 hourly 1 https://wordpress.org/?v=4.9.8 Comment on Convert MySQL to XML using PHP by felix /coding/mysql-to-xml-php/#comment-1591 Sat, 14 May 2016 13:11:47 +0000 /?p=4#comment-1591 my code is
<?php
//database configuration
$config['mysql_host'] = "localhost";
$config['mysql_user'] = "root";
$config['mysql_pass'] = "";
$config['db_name'] = "mansion";
$config['table_name'] = "property";

//connect to host
mysql_connect($config['mysql_host'],$config['mysql_user'],$config['mysql_pass']);
//select database
mysql_select_db($config['db_name']) or die( "Unable to select database");
$xml = "”;
$root_element = $config[‘table_name’].”s”;
$xml .= “”;
//select all items in table
$sql = “SELECT * FROM “.$config[‘table_name’];

$result = mysql_query($sql);
if (!$result) {
die(‘Invalid query: ‘ . mysql_error());
}

if(mysql_num_rows($result)>0)
{
while($result_array = mysql_fetch_assoc($result))
{
$xml .= “”;

//loop through each key,value pair in row
foreach($result_array as $key => $value)
{
//$key holds the table column name
$xml .= “”;

//embed the SQL data in a CDATA element to avoid XML entity issues
$xml .= “”;

//and close the element
$xml .= “”;
}

$xml.=””;
}
}
//close the root element
$xml .= “”;

//send the xml header to the browser
header (“Content-Type:text/xml”);

//output the XML data
echo $xml;
?>

Untitled Document

when i run this code……I get the error message
This page contains the following errors:

error on line 1 at column 1418: error parsing attribute name
Below is a rendering of the page up to the first error.
plzz…….help…..its very urgent

]]>
Comment on Convert MySQL to XML using PHP by Adesh Shah /coding/mysql-to-xml-php/#comment-1590 Wed, 30 Mar 2016 05:39:07 +0000 /?p=4#comment-1590 Very good explanation, but it would be really great if you guys update the mysql command with PDO or mysqli. As I tried to run following example and it showed my that mysql is depreciated.

Thanks,
Adesh

]]>
Comment on Convert MySQL to XML using PHP by Dipal Modi /coding/mysql-to-xml-php/#comment-1589 Wed, 16 Mar 2016 17:00:39 +0000 /?p=4#comment-1589 Hello,
I have an error for following code in $xml .= “”;

<?php

//Database configuration
$config['mysql_host'] = "localhost";
$config['mysql_user'] = "root";
$config['mysql_pass'] = "dipalmodi";
$config['db_name'] = "xml";
$config['table_name'] = "my_data";

//connectto host
mysql_connect($config['mysql_host'],$config['mysql_user'],$config['mysql_pass']);

//select database
@mysql_select_db($config['db_name']) or die( "Unable to select database");

$xml = "”;
$root_element = $config[‘table_name’].”s”; //my_data
$xml .= “”;

//select all items in table
$sql = “select * from “.$config[‘table_name’];

$result = mysql_query($sql);
if(!$result)
{
die(‘Invalid Query: ‘ .mysql_error());
}

if(mysql_num_rows($result)>0)
{
while($result_array = mysql_fetch_assoc($result))
{
$xml. = “”;

//loop through each key, value pair in row
foreach($result_array as $key => $value)
{
//$key holds the table column name
$xml.=””;

//embed the SQL data in a CDATA element to avoid XML entity issues
$xml.= “”;

//and close the element
$xml.=””;
}
$xml.=””;
}
}

//close the root element
$xml.=””;

//send the xml header to the browser
header(“Content-Type:text/xml”);

//output the xml data
echo $xml;

?>

please reply me ASAP.

]]>
Comment on SharePoint Lists Webservice – Traverse all Folders and Files by vladimir /coding/sharepoint-lists-webservice-traverse-all-folders-and-files/#comment-1587 Tue, 27 Oct 2015 07:40:58 +0000 /?p=218#comment-1587 100000

life saving!! thanks so much

]]>
Comment on JQuery UI Themes by Lemosys /design/jquery-ui-themes/#comment-1586 Tue, 01 Sep 2015 06:57:11 +0000 /?p=161#comment-1586 Thanks for wrote a topic on “JQuery UI Themes” topic.nice discussion on this.

]]>
Comment on Faceted navigation in PHP and MySQL Tutorial – part 1 by bobby /coding/faceted-navigation-in-php-mysql/#comment-1585 Tue, 25 Aug 2015 22:52:56 +0000 /?p=375#comment-1585 Where is part 2??????????

]]>
Comment on Convert MySQL to XML using PHP by Lemosys /coding/mysql-to-xml-php/#comment-1584 Tue, 18 Aug 2015 06:03:20 +0000 /?p=4#comment-1584 It’s really knowledgeable post for programmer. Nicely explained by developer with example.currently i am working on oracle data base so ,it’s can applicable for other database like oracle,my access .

]]>
Comment on Convert MySQL to XML using PHP by nakul /coding/mysql-to-xml-php/#comment-1583 Sat, 15 Aug 2015 11:13:55 +0000 /?p=4#comment-1583 please help my output is coming in CDATA. I want to remove that

MY CODE IS:

<?php

$config['db_name'] = "algo_marketing";
$config['table_name'] = "trade";

//connect to host
mysql_connect($config['mysql_host'],$config['mysql_user'],$config['mysql_pass']);
//select database
@mysql_select_db($config['db_name']) or die( "Unable to select database");

$xml = "”;
$root_element = $config[‘table_name’].”s”;
$xml .= “”;

//select all items in table
$sql = “SELECT * FROM “.$config[‘table_name’];

$result = mysql_query($sql);
if (!$result) {
die(‘Invalid query: ‘ . mysql_error());
}

if(mysql_num_rows($result)>0)
{
while($result_array = mysql_fetch_assoc($result))
{
$xml .= “”;

//loop through each key,value pair in row
foreach($result_array as $key => $value)
{
//$key holds the table column name
$xml .= “”;

//embed the SQL data in a CDATA element to avoid XML entity issues
$xml .= “”;

//and close the element
$xml .= “”;
}

$xml.=””;
}
}

//close the root element
$xml .= “”;

//send the xml header to the browser
header (“Content-Type:text/xml”);

//output the XML data
echo $xml;
?>

]]>
Comment on Bootstrap 2.0 Tabs JQuery Ajax Example by namrata /coding/bootstrap-2-tabs-jquery-load-content/#comment-1581 Mon, 06 Jul 2015 20:22:31 +0000 /?p=235#comment-1581 Contents means what i mean anything like JSON or what.
Can you please give me some php script.
Please

]]>
Comment on Faceted navigation in PHP and MySQL Tutorial – part 1 by Troy Francis /coding/faceted-navigation-in-php-mysql/#comment-1580 Thu, 18 Jun 2015 14:10:45 +0000 /?p=375#comment-1580 Great tutorial. I’ve been looking for this for sometime now. Looking forward to part 2

]]>