New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Comments
@blergh_ I failed to replicate the error
@alex
Wasnt directed at you, was directed at blergh. I was saying that all he really needs to do is add the column it is complaining about
sorry, quoted wrong person
@BenND
Seems as if it is spotty at best, thanks for the pointer otherwise.
@alex
You need to enable mass-adding of domains, otherwise this is as useful as a text-document with the same info.
can you expand this a bit?
@alex
What is there to elaborate? allow me to add more domain-names en mass, as it otherwise is a bitch with 100-200 names.
Essentially have a multiple-line text field that would allow you to enter multiple domains (delimiter it on carriage returns perhaps) and add them in one mass hit.
Would be a handy feature as it'd allow you to simply copy-paste from your current list.
Looks and works well though!
Please correct me if I'm wrong @joepie91 , this is an example of PDO:
$db = new PDO('mysql:host=localhost;charset=UTF-8', 'username', 'superpassword'); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); $stmt = $db->prepare("SELECT * FROM table WHERE id=?"); $stmt->bindValue(1, $id_rack, PDO::PARAM_INT); $stmt->execute(); $rack = $stmt->fetchAll(PDO::FETCH_ASSOC);
from an internal PHP I used for an automatic crane
This is how I'm using it for inserting a new domain into db:
Regular expressions are typically slower and more error-prone than specifically-made-for-the-purpose functions such as filter_var. Basically, if you are unsure which to pick, go with the non-regex solution. Only use regex if you know what you're doing, it's very easy to make a fatal mistake (one of the most common ones being the forgetting of a $ or ^).
As for PDO, both examples are valid examples, but you really shouldn't be echo'ing MySQL errors. Errors should always be logged internally, not shown to the user verbatim - they can be confusing or even expose certain information they shouldn't be exposing.
point taken, thanks again @joepie91
@alex I like what @joepie91 says about PDO and the rest as a developer personally. I wouldn't call it gospel yet But
PDO and the best practices are still the "good book" right now. If you learn as I did that you're behind in that
department it will only come back to bite you later least anything so much as simply
Looking dumb to fellow coders and all of that. Plus compliance issues in providing too much of that internal info.
To me it has turned into almost a Prototype vs jQuery thing and the winner is obvious, PDO is becomming a
necessary way to handle interactions
to that RDBMS.
Not to mention that it really isn't hard to learn at all and once you do it will turn into your best practice. So +1
PDO and the best practices are still the "good book" right now. If you learn as I did that you're behind in that
you're too late, I implemented PDO like 3 days ago
a sneak peek into the next release:
and another one: