Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/01/2022 in all areas

  1. PHPFreaks has been going through some ownership and hosting changes, and that has lead to some extended down time. The hosting for the site has been generously provided by a number of different people and organizations throughout the years, and without their patronage, phpfreaks would have shutdown many years ago. With that said, please understand that the volunteers who administer and moderate the site don't have control over the underlying infrastructure, other than what is provided to us. In this recent outage the new owner of the site, who supported it in the years following the sale of the original hosting company where phpfreaks was created, has provided us a lot of support and aid, and demonstrated a commitment to keep the site running for the foreseeable future. Unfortunately, with that said, there will probably be some additional outages in the near future as the server resources that run the site are being moved to a different co-location facility. Please bear with us through these difficulties, as we endeavor to keep the community alive and available for everyone who finds it useful. We will continue to keep doing the work to keep phpfreaks running, and we appreciate the many long time members who have made it their home.
    1 point
  2. I too am happy to see this site come back alive. Twas a surprise and a bit of a let-down with no info forthcoming . Had to make do with another site which was also down at the same time but only for a couple of days. Of course (as I have posted elsewhere) things on PHP forums seem to be at a standstill - traffic is way down. Hopefully once this site finishes with its transition, things will pick up and those of us who like to come and be of some aid to those needing it can continue to get our fix.
    1 point
  3. For starters.... The DB connection "should" be passed to the Class using Dependency Injection, not extending Dbh. The submit button does not need a name attribute You should use Guard Clauses and get rid of the elses's
    1 point
  4. Are you using PDO or MySqlI? The former is the easier one to use. That said - read the manual under PDO to see how a query statement would look and then simply do it. Here is a very brief and simplified spot of code: // (write a function that makes your connection.) $pdo = PDOConnect($dbname); // this function also sets the db name $q = "select fld1, fld2, fld3 from tablename where fld1=:argument1 and fld3=:argument3"; $qst = $pdo->prepare($q); $parms = array('argument1'=>$myvalue, 'argument3'=>$another_arg); if (!$qst->execute($parms)) { // (handle the error and exit?) } //************* //(now process the query results) As you can see this is simpler than the way MySqlI uses binds and results to manage prepared queries. PDO simply asks you to put the needed :parms into the query and then to prepare it. Then you simply set an array with the values for those parms and execute it whenever you are ready to run the query. Note: you only need to make your db connection once in a script unless you are doing something that requires a 2nd connection (??). Call the connection function once to get a handle and then keep using that handle when you need to run any query. Don't put the connect call inside a function that gets called repeatedly. Simply pass the handle to the function as one of its arguments.
    1 point
This leaderboard is set to New York/GMT-05:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.