Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 13th Nov 2011, 07:26 PM   #1
HyperActive Warrior
War Room Member
 
Join Date: 2002
Location: United States
Posts: 421
Thanks: 22
Thanked 98 Times in 74 Posts
Default
ezSQL, Django and others discussion
Share on: 
fb share twitter share gplus share more share

This is a thread offshoot from the one I created about FOREACH Loops. An off topic discussion started so I am creating this new thread to continue those.

Here is the preliminary discussion starter I am pasting from Steve Johnson from that other thread.


Originally Posted by SteveJohnson View Post

The function mysql_query returns a resource - not the actual data. You must use the 'fetch' functions to retrieve the individual rows.

The 'foreach' construct is merely a way to iterate through arrays or objects, and is a way of combining 'list' and 'each' for working with arrays.

I would highly recommend using an addon class like ezSQL ( available at Justin Vincent , or used to be ) to work with databases. It makes programming life so much easier. As a matter of fact, ezSQL is what the WordPress database functions are derived from.



Response:

Yeah Steve, I took a look at that ezSQL and read through the introduction page... The only thing I see for me of value there is the caching feature.

I actually created a couple functions that handle most the mysql calls I need, I just need to call them and choose what sort of output I want and it just takes care of it for me.

In cases where I need more specific results I created a function that all I need to do is pass a properly formatted SQL Query and it parses the data, sanitizes the data and returns it in various formats or data sets via a toggle I pass to the function.

It might of been easier to use something like this ezSQL to build this but I got it now and it works great and I just have one line to embed in any page to get whatever data I need.

Looking through the introduction page in that ezSQL my calls are actually smaller than the ones they have in their samples. Only thing I don't have that they do is caching. Maybe I will just convert some of these dynamically created pages into static pages that way no need for database caching.. LOL

Thanks,

- T
Terry Crim is offline  
Unread 14th Nov 2011, 09:52 AM   #2
VIP Warrior
War Room Member
 
SteveJohnson's Avatar
 
Join Date: 2007
Location: Caldwell, Idaho, USA.
Posts: 1,967
Thanks: 1,024
Thanked 2,043 Times in 1,183 Posts
Default
Re: ezSQL, Django and others discussion
Share on: 
fb share twitter share gplus share more share

If you have the time to create your own specialized solutions, you're almost always better off in terms of coding efficiency. Some of the popular classes, like ezSQL, get bloated by adding features that not everyone needs or will use.

The 2nd Amendment, 1789 - The Original Homeland Security.

Gun control means never having to say, "I missed you."
SteveJohnson is offline  
Closed Thread


Bookmarks

Tags
discussion, django, ezsql


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 01:30 AM.