Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


DomainAgent 0.1 Alpha released - Page 2
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.

DomainAgent 0.1 Alpha released

2»

Comments

  • alexalex Member
    edited May 2013

    @blergh_ I failed to replicate the error

  • Ben1002Ben1002 Member

    @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

  • alexalex Member

    @BenND said: Wasnt directed at you

    sorry, quoted wrong person :)

  • blergh_blergh_ Member
    edited May 2013

    @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.

  • alexalex Member

    @blergh_ said: 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?

  • blergh_blergh_ Member

    @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.

  • DomDom Member

    @alex said: can you expand this a bit?

    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!

  • netomxnetomx Moderator, Veteran

    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

  • alexalex Member
    edited May 2013

    This is how I'm using it for inserting a new domain into db:

                try {
                    $query = $conn->prepare('INSERT INTO `'.$DB_PREFIX . $DB_DOM.'` (`DomainName`, `RegID`, `RenewalDate`) VALUES (:dname, :dreg, :ddate);');
                    $query->execute(array(
                        'dname' => $dName,
                        'dreg' => $dReg,
                        'ddate' => $dDate));
                    box('Success', 'The domain has been added.', 'info' );
                } 
                catch (PDOException $e) {
                    echo 'MySQL ERROR: ' . $e->getMessage();
                    echo $conn->errorCode();
                    echo $conn->errorInfo();
                }     
    
  • joepie91joepie91 Member, Patron Provider

    @alex said: thanks for the link, but is there anything wrong with doing it with regular expressions?

    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.

  • alexalex Member

    point taken, thanks again @joepie91

  • natestammnatestamm Member
    edited May 2013

    @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

  • alexalex Member

    @natestamm said: 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

    you're too late, I implemented PDO like 3 days ago

  • alexalex Member
    edited May 2013

    a sneak peek into the next release:

    image

    and another one:
    image

Sign In or Register to comment.