0
Explorer
,
/t5/dreamweaver-discussions/php-and-spry/td-p/150783
Sep 05, 2007
Sep 05, 2007
Copy link to clipboard
Copied
Prior to XML I used to simply use PHP to execute a MySQL
query, get the result and do something with it. Sometimes this
would mean I could evaluate the returning value and, depending on
its parameters, I could do something; like not display it. How can
I do this with an XML dataset?
My current issue: I am querying the database for address info. There are 2 fields, address1 and address2. Not every record has a value in address 2 - so if I simply drag out the data elements onto the app, and there is no value, the result is a null line. It would look like this:
FirstName LastName
123 Some Road
SomeCity CA, 99999
When I want this if there is no value in address2:
FirstName LastName
123 Some Road
SomeCity CA, 99999
Prior to utilizing the XML, I would simply evaluate the returned data element using php, but I don't know how, or if, php can evaluate a returning xml value.
Thanks for any help - and if I am missing something that is really obvious; sorry.
-jacob
My current issue: I am querying the database for address info. There are 2 fields, address1 and address2. Not every record has a value in address 2 - so if I simply drag out the data elements onto the app, and there is no value, the result is a null line. It would look like this:
FirstName LastName
123 Some Road
SomeCity CA, 99999
When I want this if there is no value in address2:
FirstName LastName
123 Some Road
SomeCity CA, 99999
Prior to utilizing the XML, I would simply evaluate the returned data element using php, but I don't know how, or if, php can evaluate a returning xml value.
Thanks for any help - and if I am missing something that is really obvious; sorry.
-jacob
TOPICS
Server side applications
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
LEGEND
,
Sep 05, 2007
Sep 05, 2007
jmortimer wrote:
> Prior to XML I used to simply use PHP to execute a MySQL query, get the result
> and do something with it. Sometimes this would mean I could evaluate the
> returning value and, depending on its parameters, I could do something; like
> not display it. How can I do this with an XML dataset?
You need to add a Spry conditional to the element that might contain an
empty string:
<p spry:if="'{address2}' != ''">{address2}</p>
> Prior to utilizing the XML, I would simply evalua...
> Prior to XML I used to simply use PHP to execute a MySQL query, get the result
> and do something with it. Sometimes this would mean I could evaluate the
> returning value and, depending on its parameters, I could do something; like
> not display it. How can I do this with an XML dataset?
You need to add a Spry conditional to the element that might contain an
empty string:
<p spry:if="'{address2}' != ''">{address2}</p>
> Prior to utilizing the XML, I would simply evalua...
LEGEND
,
LATEST
/t5/dreamweaver-discussions/php-and-spry/m-p/150784#M140509
Sep 05, 2007
Sep 05, 2007
Copy link to clipboard
Copied
jmortimer wrote:
> Prior to XML I used to simply use PHP to execute a MySQL query, get the result
> and do something with it. Sometimes this would mean I could evaluate the
> returning value and, depending on its parameters, I could do something; like
> not display it. How can I do this with an XML dataset?
You need to add a Spry conditional to the element that might contain an
empty string:
<p spry:if="'{address2}' != ''">{address2}</p>
> Prior to utilizing the XML, I would simply evaluate the returned data element
> using php, but I don't know how, or if, php can evaluate a returning xml value.
PHP normally has nothing to do with the display of Spry data sets.
--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
> Prior to XML I used to simply use PHP to execute a MySQL query, get the result
> and do something with it. Sometimes this would mean I could evaluate the
> returning value and, depending on its parameters, I could do something; like
> not display it. How can I do this with an XML dataset?
You need to add a Spry conditional to the element that might contain an
empty string:
<p spry:if="'{address2}' != ''">{address2}</p>
> Prior to utilizing the XML, I would simply evaluate the returned data element
> using php, but I don't know how, or if, php can evaluate a returning xml value.
PHP normally has nothing to do with the display of Spry data sets.
--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

