php-general Digest 23 Nov 2009 14:38:57 -0000 Issue 6456

Topics (messages 300033 through 300037):

PHP and XML
        300033 by: Juan Marcelo Rodríguez Monti
        300035 by: Phpster
        300036 by: Sudheer Satyanarayana

Re: Using $$
        300034 by: LinuxManMikeC

Re: Which query is more correct?
        300037 by: LAMP

Administrivia:

To subscribe to the digest, e-mail:
        [email protected]

To unsubscribe from the digest, e-mail:
        [email protected]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
Hi people,
I have some doubts about this topic that I'm gonna explain.

I have a few sites in flash, and I was requested to write a PHP frontend to send news. I have this already done and it works perfect. It's a LAMP App to send and edit news, post video, images and so on.

Then, I need to put all this news into the Flash site. So, I need to use XML. I'm not gonna discuss about Flash, because this is a PHP List, however I would like to talk about PHP and XML.

What do you recommend me to produce XML from those news of the SQL database?. What do you suggest to output XML from the existing content to then put those XML files into Flash.

The posted news are saved in a MySQL database. I don't know if do I need to output from PHP then parse the output and convert it to XML, or if Do I need to get the array from the MySQL and directly output this to an XML file to then get from this file from Flash.

Thanks,
Juan.


--- End Message ---
--- Begin Message --- I would just use concatenations and strings to build the XML. It's not gonna matter to the flash swf when it gets the string as it will attempt the data as XML.
Bastien

Sent from my iPod

On Nov 22, 2009, at 2:27 PM, Juan Marcelo Rodríguez Monti <[email protected] r> wrote:

Hi people,
I have some doubts about this topic that I'm gonna explain.

I have a few sites in flash, and I was requested to write a PHP frontend to send news. I have this already done and it works perfect. It's a LAMP App to send and edit news, post video, images and so on.

Then, I need to put all this news into the Flash site. So, I need to use XML. I'm not gonna discuss about Flash, because this is a PHP List, however I would like to talk about PHP and XML.

What do you recommend me to produce XML from those news of the SQL database?. What do you suggest to output XML from the existing content to then put those XML files into Flash.

The posted news are saved in a MySQL database. I don't know if do I need to output from PHP then parse the output and convert it to XML, or if Do I need to get the array from the MySQL and directly output this to an XML file to then get from this file from Flash.

Thanks,
Juan.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---

What do you recommend me to produce XML from those news of the SQL database?. What do you suggest to output XML from the existing content to then put those XML files into Flash.

The posted news are saved in a MySQL database. I don't know if do I need to output from PHP then parse the output and convert it to XML, or if Do I need to get the array from the MySQL and directly output this to an XML file to then get from this file from Flash.
From your PHP script, query the database, obtain the results in an array or object. Using the result variable build the XML file.


--

With warm regards,
Sudheer. S
Tech stuff: http://techchorus.net - Pro PHP XML - Book Review
Business: http://binaryvibes.co.in


--- End Message ---
--- Begin Message ---
On Fri, Nov 20, 2009 at 12:28 AM, Arno Kuhl <[email protected]> wrote:
> -----Original Message-----
> From: Ford, Mike [mailto:[email protected]]
> Sent: 19 November 2009 07:06 PM
> To: [email protected]
> Subject: RE: [PHP] Using $$
>
>> -----Original Message-----
>> From: Arno Kuhl [mailto:[email protected]]
>> Sent: 19 November 2009 12:23
>>
>> I was looking at some old code that I'm convinced once worked but now
>> using
>> php5 it doesn't seem to work anymore.
>>
>> $input = "_REQUEST";
>> if (is_array($$input)) {
>>     // do something
>> }
>
>
>> I tested something other than a superglobal and it works as expected.
>> What am I missing?
>
>
> Depends where you have this fragment of code, but possibly the big fat
> warning box towards the bottom of
> http://php.net/language.variables.variable?
>
> Cheers!
>
> Mike
>  --
>
> Thanks for the link Mike, didn't know that. It doesn't say when this was
> introduced but I'm sure superglobal variable variables must have worked at
> some stage, because I've got code that once worked but doesn't anymore and
> it's due to this. There's always a workaround, just not as elegant.
>
> Cheers
> Arno
>
>

The problem got me curious, so I got hackin.  The workaround in
functions and methods is to access it through the $GLOBALS superglobal
array.  Here's some code I threw together in an interactive PHP
terminal.

php > function test_nowork($vn) { var_dump($$varname);}
php > test_nowork('_ENV');
NULL

php > function test_work($vn) { var_dump($GLOBALS[$vn]); }
php > test_work('_ENV');
array(##) {
  ["ORBIT_SOCKETDIR"]=>...
  ["SSH_AGENT_PID"]=>...
  ["GPG_AGENT_INFO"]=>...
  ["TERM"]=>...
  ["SHELL"]=>...
...

--- End Message ---
--- Begin Message ---
Rick Pasotto wrote:
On Fri, Nov 20, 2009 at 04:41:58PM -0600, LAMP wrote:
Hi,
I need to pull all records from the table Registrants they are NOT
in the table ToBeRecleared

Registrants.Reg_ID is PK
ToBeRecleared.tbrc_Reg_ID is PK

Which query is more correct?

SELECT r.*
FROM registrants r
where r.reg_status=1 AND r.reg_id NOT IN (SELECT tbrc_reg_id FROM
toberecleared)


SELECT r.*
FROM registrants r
where r.reg_status=1 AND (SELECT count(*) FROM toberecleared where
tbrc_reg_id=r.reg_id) = 0

I checked explain of bot queries - but can't "read" them.  :-)

SELECT t1.*
FROM registrants t1
LEFT JOIN ToBeRecleared t2 on t1.reg_id = t2.tbrc_reg_id
where t2.tbrc_reg_id is NULL

thanks!
:-)

--- End Message ---

Reply via email to