Home Private Messages Search
CPG Dragonfly™ CMS Dedicated Server & Bandwidth Sponsored by DedicatedNOW
Toggle Content
 
Forums ⇒ CMS (All) ⇒ CVS Info ⇒ New SQL classes


New SQL classes
Global information regarding the state of our CVS and changes committed. Members are only allowed to reply to these topics.
Go to page 1, 2  Next
Post new topic    Reply to topic    Printer Friendly Page     Forum Index ⇒  CVS Info

View previous topic :: View next topic  
Author Message
DJ Maze
Developer
Developer

Offline Offline
Joined: Apr 19, 2004
Posts: 5683
Location: http://tinyurl.com/5z8dmv
PostPosted: Thu Nov 04, 2010 9:05 am
Post subject: New SQL classes

I've added a new SQL library.
It tries to be compatible with the old system BUT is more strict when it comes to writing SQL queries.
Correct ANSI/ISO syntax is required to make the most cross-db implementation possible.

So, if you find any SQL errors that weren't there, here's your chance to make them ISO SQL-92 compliant.

New features:

Example:
PHP:
$result = $db->query("SELECT * FROM {$SQL->TBL->admins}");

$result->num_rows;

foreach (
$result as $index => $values)
{
// code here
}


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 15 / 2.2.22 / 5.5.20 / 5.3.10 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger Photo Gallery
NanoCaiordo
Developer
Developer

Offline Offline
Joined: Jun 29, 2004
Posts: 3878
Location: Melbourne, AU
PostPosted: Thu Nov 04, 2010 11:27 pm
Post subject: Re: New SQL classes

PHP:
// To sync DB:
$db->XML->sync_schema_from_file($file)

// To create a XML export scheme
header('Content-Type: application/xml');
$db->XML->export_schema(fopen('php://output', 'w'));
exit;

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

Linux 64bit / Apache 2.2 / PHP 5.4 / MySQL 5.5.22 / v9, v10
Linux 32bit / Apache 2.2 / PHP 5.3.10 / MySQL 5.5.22 / v9, v10
Windows 64bit / IIS 7.5 / PHP 5.3.10 / MySQL 5.5.22 / v9, v10


NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
mixed
Back to top
View user's profile Visit poster's website Photo Gallery
Phoenix
• Many Posts •
• Many Posts •

Offline Offline
Joined: Apr 19, 2004
Posts: 8799
Location: Netizen
PostPosted: Sun Nov 07, 2010 7:16 am
Post subject: Re: New SQL classes

A tip to existing CVS users - do not update.

CVS is severely broken as a result of this change and is not functional.


Phoenix's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website Photo Gallery
DJ Maze
Developer
Developer

Offline Offline
Joined: Apr 19, 2004
Posts: 5683
Location: http://tinyurl.com/5z8dmv
PostPosted: Sun Nov 07, 2010 12:24 pm
Post subject: Re: New SQL classes

Problem currently still relies in 4 methods:
  • list_databases
  • list_tables
  • list_columns
  • list_indexes
Working my ass off to get this incompatibility fixed.


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 15 / 2.2.22 / 5.5.20 / 5.3.10 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger Photo Gallery
DJ Maze
Developer
Developer

Offline Offline
Joined: Apr 19, 2004
Posts: 5683
Location: http://tinyurl.com/5z8dmv
PostPosted: Sun Nov 07, 2010 5:57 pm
Post subject: Re: New SQL classes

Install should work again.
Please inform when something is still fails at install (not after!)


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 15 / 2.2.22 / 5.5.20 / 5.3.10 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger Photo Gallery
Phoenix
• Many Posts •
• Many Posts •

Offline Offline
Joined: Apr 19, 2004
Posts: 8799
Location: Netizen
PostPosted: Sun Nov 07, 2010 10:45 pm
Post subject: Re: New SQL classes

Let's build the database gives the impression of nothing happening, which might prompt extra clicking of the button.

Unimpeded, it eventually breaks with:
Code::
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') VALUES ('26','6','2000','Francisco Burzi registers the PHP-Nuke project at Sou' at line 1
core.xml history data set obviously hasn't converted properly - several fields have extra column(s) of data.
sql/data/core.xml fix committed (twice)

Code::
Fatal error: require() [function.require]: Failed opening required '/install/sql/data/core.php' (include_path='.:/includes:/usr/lib/php:/usr/local/lib/php') in /install/sql/new.php on line 20


Phoenix's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website Photo Gallery
DJ Maze
Developer
Developer

Offline Offline
Joined: Apr 19, 2004
Posts: 5683
Location: http://tinyurl.com/5z8dmv
PostPosted: Thu Nov 11, 2010 5:33 pm
Post subject: Re: New SQL classes

Thanks phoenix!

I've added the missing table data and added a unique index on security table to prevent duplicate entries.


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 15 / 2.2.22 / 5.5.20 / 5.3.10 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger Photo Gallery
DJ Maze
Developer
Developer

Offline Offline
Joined: Apr 19, 2004
Posts: 5683
Location: http://tinyurl.com/5z8dmv
PostPosted: Thu Nov 11, 2010 9:39 pm
Post subject: Re: New SQL classes

Just added XML support for PostgreSQL


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 15 / 2.2.22 / 5.5.20 / 5.3.10 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger Photo Gallery
Phoenix
• Many Posts •
• Many Posts •

Offline Offline
Joined: Apr 19, 2004
Posts: 8799
Location: Netizen
PostPosted: Thu Nov 11, 2010 9:47 pm
Post subject: Re: New SQL classes

Code::
Remove install.php and the install directory right now! 
Database installed without error, but no forum or PM tables.

Unfortunately, it doesn't proceed to Gather important info & Create super admin account


Phoenix's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website Photo Gallery
Phoenix
• Many Posts •
• Many Posts •

Offline Offline
Joined: Apr 19, 2004
Posts: 8799
Location: Netizen
PostPosted: Fri Nov 12, 2010 11:35 am
Post subject: Re: New SQL classes

New install now proceeds to completion Applause

Post-install issues here


Phoenix's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website Photo Gallery
movix
Nice poster
Nice poster

Offline Offline
Joined: Feb 10, 2008
Posts: 131

PostPosted: Fri Nov 12, 2010 12:47 pm
Post subject: Re: New SQL classes

Hello,

Just a question about those new SQL functionalities, would it be possible to have the FULL parameter added to the get_column method in order to retreive comments on the table columns.

i know that the request will be much longer to perform upon using the FULL option, so perhaps it can be optionally set on the get_clolumn method.

Hope the question is clear.


movix's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache/MySQL 5.1.49/PHP 5.3.6/ DF 9.3.2.0
Back to top
View user's profile Visit poster's website
DJ Maze
Developer
Developer

Offline Offline
Joined: Apr 19, 2004
Posts: 5683
Location: http://tinyurl.com/5z8dmv
PostPosted: Fri Nov 12, 2010 5:27 pm
Post subject: Re: New SQL classes

movix wrote:
Just a question about those new SQL functionalities, would it be possible to have the FULL parameter added to the get_column method in order to retreive comments on the table columns.

There is no get_column.
Instead use:
Code::
$db->list_columns(table_name);
It will return a multidimensional array as:
Code::
array(
	'column_name' => array(
		'type'  => (string),
		'notnull' => (boolean),
		'default' => (string),
		'extra' => (string),
		'comment' => (string)
	),
	......
)


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 15 / 2.2.22 / 5.5.20 / 5.3.10 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger Photo Gallery
movix
Nice poster
Nice poster

Offline Offline
Joined: Feb 10, 2008
Posts: 131

PostPosted: Fri Nov 12, 2010 7:10 pm
Post subject: Re: New SQL classes

Hi DZ Maze,

Thanks for your reply.
Yes is is indeed list_columns.
Correct me, but this method did not returned the comment in 9.x

Movix


movix's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache/MySQL 5.1.49/PHP 5.3.6/ DF 9.3.2.0
Back to top
View user's profile Visit poster's website
DJ Maze
Developer
Developer

Offline Offline
Joined: Apr 19, 2004
Posts: 5683
Location: http://tinyurl.com/5z8dmv
PostPosted: Fri Nov 12, 2010 11:32 pm
Post subject: Re: New SQL classes

movix wrote:
Correct me, but this method did not returned the comment in 9.x
Correct, it didn't.
Now it does as it is supported by our XML DB schema.xsd.
Due to that we can add comments to tables and columns in xml db schemas like core.xml


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 15 / 2.2.22 / 5.5.20 / 5.3.10 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger Photo Gallery
movix
Nice poster
Nice poster

Offline Offline
Joined: Feb 10, 2008
Posts: 131

PostPosted: Fri Nov 12, 2010 11:48 pm
Post subject: Re: New SQL classes

what about perfomance when using the FULL option in the query to retrieve comments and extra ?
Is it worth to make this optional upon calling the method ?
For my part i noticed that the query tooks about 10 times longer when using the FULL option in the query.


movix's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache/MySQL 5.1.49/PHP 5.3.6/ DF 9.3.2.0
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 Index ⇒  CVS Info
Page 1 of 2
All times are GMT
Go to page 1, 2  Next



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


 
   Toggle Content User Info

Welcome Anonymous

Nickname
Password
(Register)

   Toggle Content Last CVS commits
· Fixed .ico Expires header.
· Removed domain name from cookies so subdomains wont access them anymore.
· CSS and JS, case insensitives.
· CSS and JS, send correct HTTP 1.1 headers and fixed issues where themes and...
· Further security class improvements.
· 301 redirects on LEO changes
· Option to force 3xx http status codes
· Validate googlebot.com and google.com crawlers.
· CCBot
· Rss with etag and atom.

pročitaj još...

   Toggle Content Community

Support for DragonflyCMS in a other languages:

Deutsch
Español

   Toggle Content X-links
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

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
Interactive software released under GNU GPL, Code Credits, Privacy Policy