db.php $query?
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexExplain Please
Author Message
earth
Heavy poster


Joined: Mar 01, 2006
Posts: 268

PostPost subject: db.php $query?
Posted: Wed Jun 30, 2010 3:33 pm
Reply with quote

includes/DB/db.php changes noted and running into a bug in pronews with linking from the forums for comments and got a few errors and was wondering if this is totally correct in 9.2.3 and what is unset vs null results functions?


9.2.3

PHP:
$query_id = NULL;

9.2.1

PHP:
unset($query_id);

_________________
dfaddons.com

earth's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
OS/Apache/Mysql/php/9.2.X/
Back to top
View user's profile Visit poster's website
InspectorClueNo
Heavy poster


Joined: Mar 26, 2008
Posts: 215

PostPost subject: Re: db.php $query?
Posted: Wed Jun 30, 2010 11:59 pm
Reply with quote

sorry earth if I don't understand your question ... do you have a bug in pronews caused by the change in cvs? do you want to know the difference between query_id be null instead unset?

InspectorClueNo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
none available
Back to top
View user's profile Visit poster's website
earth
Heavy poster


Joined: Mar 01, 2006
Posts: 268

PostPost subject: Re: db.php $query?
Posted: Thu Jul 01, 2010 11:54 am
Reply with quote

not sure inpspectorCN, yes there is a bug with pronews it seems, that is related and just thought would ask here to see if there is problem, as I updated with new db.php and then replaced it and not sure that is the way to fly!
_________________
dfaddons.com

earth's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
OS/Apache/Mysql/php/9.2.X/
Back to top
View user's profile Visit poster's website
NanoCaiordo
Developer


Joined: Jun 29, 2004
Posts: 3676
Location: Melbourne, AU

PostPost subject: Re: db.php $query?
Posted: Thu Jul 01, 2010 12:36 pm
Reply with quote

Since you think it's related to the specified cvs update and since you have all details and the required module is already installed, did you try reverting the code back to see if pronews's bug disappear.
_________________
.:: I met php the 03 December 2003 :: Unforgettable day! ::.

NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
MySQL 5.1 / PHP 5.3 / NextGen()
Back to top
View user's profile Visit poster's website
earth
Heavy poster


Joined: Mar 01, 2006
Posts: 268

PostPost subject: Re: db.php $query?
Posted: Fri Jul 02, 2010 2:13 am
Reply with quote

yes, the issue went away, with the db.php rollback...only file changed.

note in my pronews posts on it, for more description, on the issue and errors, as this may be a bug report and this is 9.2.3 that is in the downloads posted here, presumably not cvs, and not df10, as I get confused on what is what, as clear download of cvs, df10, 9.2.3 branch, with details of each defined, like on the homepage, might help!

_________________
dfaddons.com

earth's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
OS/Apache/Mysql/php/9.2.X/
Back to top
View user's profile Visit poster's website
InspectorClueNo
Heavy poster


Joined: Mar 26, 2008
Posts: 215

PostPost subject: Re: db.php $query?
Posted: Fri Jul 02, 2010 2:32 am
Reply with quote

As far I understood it's like a cvs snapshot but for the 9.2 branch ... nano called this something like a pre RC if I remember correctly ... hope it puts some light on it

InspectorClueNo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
none available
Back to top
View user's profile Visit poster's website
earth
Heavy poster


Joined: Mar 01, 2006
Posts: 268

PostPost subject: Re: db.php $query?
Posted: Fri Jul 02, 2010 2:30 pm
Reply with quote

thanks, I read that, however nano may not be as attention deficit as I am, as you feel me on the clarification on the homepage?

Like up top big download icon image with say 3 releases posted
version may not be correct here


DF 9.2.1.X stable release currently with green light on it
df 9.2.3.x Branch Snapshot with descript yellow light
df 10 cvs with a red light and descript

could be ajax jquery where you hover over the one package and and the info pops up and the direct download link, no running around, no captcha, no bs.

_________________
dfaddons.com

earth's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
OS/Apache/Mysql/php/9.2.X/
Back to top
View user's profile Visit poster's website
Eestlane
I18N / L10N Lead Dev


Joined: Apr 06, 2005
Posts: 1406
Location: Estonia

PostPost subject: Re: db.php $query?
Posted: Sat Jul 03, 2010 8:42 pm
Reply with quote

In case someone wanted to know difference between NULL and unset, then unset doesn't remove value from memory, while NULL would. Probably more important, when used pointers as PHP probably does garbage collection once in a while anyway.

Eestlane's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.0.63/5.0.67/5.2.8/9.2.1
Back to top
View user's profile Send e-mail Visit poster's website
NanoCaiordo
Developer


Joined: Jun 29, 2004
Posts: 3676
Location: Melbourne, AU

PostPost subject: Re: db.php $query?
Posted: Sun Jul 04, 2010 3:41 am
Reply with quote

Unset will remove the variable name and the value, marking the memory as reusable.
Null instead will only remove the value while maintaining the variable active.

At the end of the script every variable, or any object in general, will lose their value but the memory chunk used will still remain in the memory and marked as reusable.

User script side.
Unset, will practically mark the variable as it doesn't exists anymore.
Null, variable still exists but has no value.
Depends how your script work, you should choose null or unset accordingly.

Performance wide.
null is way faster then unset.
no noticeable memory difference when using either null or unset.

_________________
.:: I met php the 03 December 2003 :: Unforgettable day! ::.

NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
MySQL 5.1 / PHP 5.3 / NextGen()
Back to top
View user's profile Visit poster's website
Eestlane
I18N / L10N Lead Dev


Joined: Apr 06, 2005
Posts: 1406
Location: Estonia

PostPost subject: Re: db.php $query?
Posted: Sun Jul 04, 2010 9:23 am
Reply with quote

unset would remain the value, if anything still uses it, though.

Example:

PHP:
// unset($a)
$a = 5;
$b = & $a;
unset(
$a);
print
"b $b "; // b 5

// $a = NULL;
$a = 5;
$b = & $a;
$a = NULL;
print
"b $b "; // b
print(! isset($b)); // 1

?>


Eestlane's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.0.63/5.0.67/5.2.8/9.2.1
Back to top
View user's profile Send e-mail Visit poster's website
NanoCaiordo
Developer


Joined: Jun 29, 2004
Posts: 3676
Location: Melbourne, AU

PostPost subject: Re: db.php $query?
Posted: Sun Jul 04, 2010 11:45 am
Reply with quote

No one said anything about references but thanks to share your findings.

Earth, this is an easy example about null vs unset:
PHP:
$a = null;
var_dump(isset($a)); #false
var_dump(is_null($a)); #true

unset($a);
var_dump(isset($a)); #false
var_dump(is_null($a)); #warning
isset() and empty() will never give out warnings because these are prepared to deal with unset variables.

unset will remove the variable from the script and if you use any other function then isset() or empty() you will get undefined variable warnings.

However php.net offer an online documentations with plenty of users comments that comes very handy if you want to extend your knowledge.

_________________
.:: I met php the 03 December 2003 :: Unforgettable day! ::.

NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
MySQL 5.1 / PHP 5.3 / NextGen()
Back to top
View user's profile Visit poster's website
earth
Heavy poster


Joined: Mar 01, 2006
Posts: 268

PostPost subject: Re: db.php $query?
Posted: Sun Jul 04, 2010 1:11 pm
Reply with quote

thank you nano, for taking the time to respond, as was more concerned about how the change impacts and relates to us/things here, than what understanding gained by reading the manual for php.


Thanks again!


P.S. Sure php6 is being discussed around here, so will search for where, before mentioning it here!

_________________
dfaddons.com

earth's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
OS/Apache/Mysql/php/9.2.X/
Back to top
View user's profile Visit poster's website
NanoCaiordo
Developer


Joined: Jun 29, 2004
Posts: 3676
Location: Melbourne, AU

PostPost subject: Re: db.php $query?
Posted: Sun Jul 04, 2010 2:44 pm
Reply with quote

Going back to the main topic, I will need to look into it since it was not supposed to create any issue, site or modules wide.

I made the change to remove few warnings but I guess wasn't the right one to do.

Are you able to localize the source of the bug? hint: must start from a sql query.

If so, copy the query + few lines before and after the query here.

_________________
.:: I met php the 03 December 2003 :: Unforgettable day! ::.

NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
MySQL 5.1 / PHP 5.3 / NextGen()
Back to top
View user's profile Visit poster's website
earth
Heavy poster


Joined: Mar 01, 2006
Posts: 268

PostPost subject: Re: db.php $query?
Posted: Sun Jul 04, 2010 5:48 pm
Reply with quote

have you tried to upgrade from any previous version to 9.2.3.X, as you have to log out and back in, to see main admin options, and the forums not installing correctly or something, bug, could be related...as a guess, as it happen on 5 upgrades, as swapping back resolved it, if you want, will give you admin account at one of our dfa test sites where you can replicate and see it for yourself, via link and if you would like ftp access to change the file back and forth and if you need db access, as well, to modify anything on the test site, as trying to get full on demo out and notice you asking djmaze about radmin and was wondering what that is in regards to, and anyways, will not go off topic here, further and will reproduce the error later on, if did not post the details in pronews thread, as guess left that part off and have to add the promote forum topic hack on an install, so chances are will see it, as already reverted the file and error goes away and it functions as intended.

Little busy today and tomorrow, so if you do not get a response back. please forgive it, as Tuesday and this week, should be around more and available~!

_________________
dfaddons.com

earth's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
OS/Apache/Mysql/php/9.2.X/
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexExplain Please All times are GMT
Page 1 of 1


Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

stopsoftwarepatents.eu petition banner
User Info [x]

Welcome Anonymous

Nickname
Password
(Register)

Last CVS commits [x]

Languages [x]

Community [x]

Support for DragonflyCMS in a other languages:

Deutsch
Español

X-links [x]
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

Preview theme [x]
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.


You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
This page generated in 0.9695 seconds with 19 DB Queries in 0.1472 seconds
Memory Usage: 3.02 MB
Interactive software released under GNU GPL, Code Credits, Privacy Policy