MySQL Forums
Forum List  »  Connector/Node.js

convert to PHP
Posted by: Gordon White
Date: July 17, 2011 08:27PM

I have a php script and need a section translated to PHP/XML, can someone help?


echo "<Carousel>\n";

 $path = "";; 

$sql = "(select a.im_name, a.description, from images a, department b where a.dpt_id = '$pid' and a.dpt_id = b.dpt_id)";

$result = mysql_query($sql);

while($row = mysql_fetch_array($result))
  		/* This works */
  		print $row['im_name'];
  		print "&nbsp;";
  		print $row['name'];
  		print "&nbsp;";
  		print $row['description'];
  		print "<br>";
  		/* end works */
	//* Somehow I need to plug the above into the below, Every time I try I get ERRORS *//
	//* <photo image="images/(im_name)" url="(path)/(name)/index.php" target="_self"><![CDATA[(description)]]></photo> *//

echo "</Carousel>\n";


I just need this fixed:
<photo image="images/(im_name)" url="(path)/(name)/index.php" target="_self"><![CDATA[(description)]]></photo>

Using $row['im_name'] for (im_name) and
$path = ""; for (path)
$row['name'] for (name) and
$row['description'] for (description).

I tried this:
		echo "<photo image=\"".$path."images/".$row['im_name']."\"";
		echo "url=\"".$path.$row['name']."/index.php\" target=\"_self\">";
		echo "<![CDATA[".$row['description']."]></photo>";

and nothing, no data or I get a syntax error.

Thank you

Options: ReplyQuote

Written By
convert to PHP
July 17, 2011 08:27PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.