TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The last PHP wrapper for MySQL you'll ever need

2 pointsby gtklockerover 13 years ago

3 comments

Rustover 13 years ago
<a href="https://github.com/indyarmy/MDW" rel="nofollow">https://github.com/indyarmy/MDW</a><p>This has the limitation of not being able to chain queries via OOP, but does use PDO and is tested enough to be considered stable.
PythonDeveloperover 13 years ago
Ok.. constructive criticism here... not trolling...<p>A) Not a class. Who writes non-oop PHP anymore? B) Globals. Seriously? What if I need 2 connections in a page load? This won't work. C) Use PDO.<p>I see the value of the exercise, and I applaude you for it, but PDO has TRILLIONS of sql queries under its belt.<p>You should use PDO.
评论 #3278501 未加载
noduermeover 13 years ago
Couple other issues with this, which make it not very useful... for one thing, SELECT * is notoriously slow compared with selecting just the columns you want, and your select wrapper doesn't allow for joins which makes it less robust. Plus there's no way this can handle subqueries or anything like that obviously, so it's not really uh, useful.<p>More critically, you're using a lot of addslashes, which is not a safe way to escape input. You need to use mysql_real_escape_string or you're open to injection attacks.