2 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
shinobiesdf says

Hi!

I’m looking forward to write a PHP class to handle MySQL databases and I know there’s so many out there, but in general or they do much or they do nothing.

So I would like to ask you guys, what do you expect from this kind of class?

The main purpose is to create a item that would sell, but since I’m not too optimistic, at least I could use a better one for my apps.

I would be grateful if you could lose some of of time to tell me what features would be nice to have in this to be made – i hope -, DAL or…if I should give up.

Cheers. \o

23 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $100+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
spaceship9 says

A DBA layer shouldn’t be for just Mysql. a DBA layer should allow someone to switch between several different database systems without changing any code. ie $DB->connect() should connect to mysql, mssql, oracle and a bunch of others, and $DB->query() should be able to query numerous databases as well. If it’s just for mysql, it’s a wrapper not an abstraction layer.

2 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
shinobiesdf says
A DBA layer shouldn’t be for just Mysql. a DBA layer should allow someone to switch between several different database systems without changing any code. ie $DB->connect() should connect to mysql, mssql, oracle and a bunch of others, and $DB->query() should be able to query numerous databases as well. If it’s just for mysql, it’s a wrapper not an abstraction layer.

Makes sense. Thanks for telling me the difference. :D Then I should change the title of this thread. But I can’t, I guess. >_<

3 posts
  • Has been part of the Envato Community for over 4 years
CustomCode says
I’m looking forward to write a PHP class to handle MySQL databases and I know there’s so many out there, but in general or they do much or they do nothing.

Don’t waste your time. There are already too many free alternatives (that function properly).

3303 posts
  • Provided great contribution to our forums
  • Nominated Community Superstar of the month
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
+18 more
dtbaker Moderator says

I’d say go for it! Make your own and learn how they work. Too many people just pick up code that works and don’t understand or appreciate it.

Maybe start with a few basic sql queries like: SELECT * FROM `product` WHERE `title` LIKE ‘ value ’ and build up features in your own class that allow this to happen, eg:

$mysql = new mysql_class();
$mysql -> connect();
$mysql -> set_table(‘product’);
$mysql -> set_search(‘title’,’LIKE’,’value’);
$results = $mysql -> get_results();

once you get the basics working, see if you can get more complicated queries working like ordering, grouping and finally sql joins (tricky to abstract!). also keep in mind sql injection, lot of people who use existing tools don’t understand how that works, so make sure you implement that to some degree.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by