2 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
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
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 100 and 1 000 dollars
  • United States
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
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
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 a member for 4-5 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).

2960 posts
  • Football Contest Participant/Runner-up
  • Australia
  • Community Moderator
  • Elite Author
  • Author had a Free File of the Month
  • Most Wanted Bounty Winner
  • Author had a File in an Envato Bundle
  • Has been a member for 5-6 years
  • Contributed a Blog Post
+11 more
dtbaker Volunteer 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.

by
by
by
by
by
by