Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
pdo
- Page 1
Re: Multiple MySQL connections + transactions
Programming
Databases
1 Month Ago
by toneewa
… done if you use the InnoDB storage engine. Create separate
PDO
connections for each database. I wonder what kind of results…
Re: pdo does not return an error
Programming
Web Development
11 Years Ago
by pritaeas
$
pdo
->setAttribute(
PDO
::ATTR_ERRMODE,
PDO
::ERRMODE_EXCEPTION);
PDO help "Call to a member function prepare() on a non-object"
Programming
Web Development
14 Years Ago
by tyop
… return ($dbh); $dbh->setAttribute(
PDO
::ATTR_ERRMODE,
PDO
::ERRMODE_EXCEPTION); }[/CODE] Then the script that…to be :( $sth->bindParam(':email', $email_address,
PDO
::PARAM_STR); $sth->execute (); $count = 0;… :user"); $sth->bindParam(':user', $username,
PDO
::PARAM_STR); $sth->execute (); $count = 0; …
PDO connection simple problem.
Programming
Web Development
12 Years Ago
by Clanstrom
…try { $
pdo
= new
PDO
('mysql:host=localhost;dbname=someDatabase', $username, $password); $
pdo
->setAttribute(
PDO
::ATTR_ERRMODE,
PDO
::ERRMODE_EXCEPTION); $stmt = $
pdo
->prepare('…I have many queries. include('pdo_connection_file.php'); $stmt = $
pdo
->prepare('UPDATE someTable SET name = :name WHERE id =…
Re: PDO connection simple problem.
Programming
Web Development
12 Years Ago
by Atli
…tend to be better of with exceptions, but
PDO
does not insist on it. In fact, by default…line that tells
PDO
to use exceptions: $
pdo
->setAttribute(
PDO
::ATTR_ERRMODE,
PDO
::ERRMODE_EXCEPTION); If you simply remove it,
PDO
will stop throwing…will instead rely on you testing statements and other
PDO
return values as you would have done with the …
Re: PDO connection simple problem.
Programming
Web Development
12 Years Ago
by Atli
…lt;?php /** File: db.php */ try { $dbLink = new
PDO
("mysql:etc...", "usr", "pwd"…;); $dbLink->setAttribute(
PDO
::ATTR_ERRMODE,
PDO
::ERRMODE_EXCEPTION); $dbLink->setAttribute(
PDO
::ATTR_DEFAULT_FETCH_MODE,
PDO
::FETCH_OBJ); } catch (PDOException $e) { …
Re: pdo - how to put where clause in while loop
Programming
Web Development
9 Years Ago
by diafol
… statement not a query. $
pdo
= Database::connect(); $
pdo
->setAttribute(
PDO
::ATTR_ERRMODE,
PDO
::ERRMODE_EXCEPTION); $sql = "…(array($didno)); $mobil = $stmt->fetchAll(
PDO
::FETCH_COLUMN,0); $mobile1list = implode(",", …do: `$mobil = $stmt->fetchAll(
PDO
::FETCH_COLUMN |
PDO
::FETCH_UNIQUE,0)` or you can do …
Re: PDO help "Call to a member function prepare() on a non-object"
Programming
Web Development
14 Years Ago
by Ezzaral
Add[CODE]try { $dbh = new
PDO
( ... ); } catch (PDOException $e) { echo 'Connection failed: ' . $e->getMessage(); }[/CODE] just to be sure. Curious why are you making $dbh global and also returning it from the function. That seems redundant and prone to causing some confusing behavior later.
pdo - how do I avoid ugly errors?
Programming
Web Development
11 Years Ago
by klemme
Hi All, Im trying to learn how to use
pdo
, and am curious to know how i best can deal … __construct( $DSN, $USER = '', $PASS = '', $DRIVER_OPTIONS = array(
PDO
::ATTR_ERRMODE =>
PDO
::ERRMODE_EXCEPTION) ) { // OPRET
PDO
OBJECT FRA PARENT
PDO
CLASS : parent::__construct( $DSN, $USER, $PASS, $DRIVER_OPTIONS…
pdo normalize mysql table
Programming
Web Development
7 Years Ago
by Bacchus_1
…dbname={$DB_name}",$DB_user,$DB_pass); $DB_con->setAttribute(
PDO
::ATTR_ERRMODE,
PDO
::ERRMODE_EXCEPTION); } catch(PDOException $e) { echo $…rowCount()>0) { while($row=$stmt->fetch(
PDO
::FETCH_ASSOC)) { ?> <tr> …
Re: pdo normalize mysql table
Programming
Web Development
7 Years Ago
by seularts
…dbname={$DB_name}",$DB_user,$DB_pass); $DB_con->setAttribute(
PDO
::ATTR_ERRMODE,
PDO
::ERRMODE_EXCEPTION); } catch(PDOException $e) { echo $…()>0) { while($row=$stmt->fetch(
PDO
::FETCH_ASSOC)) { ?> <tr> …
PDO vs MySQLi
Programming
Web Development
14 Years Ago
by gunnarflax
…discussed several times before and that "
PDO
(PHP Database Object) works with multiple databases&…'ve never found an answer on if
PDO
is the new and upcoming database access …existed for decades? Should I be migrating to
PDO
? Does all web hosting services support this?…? Is it hard to find support for
PDO
problems I face? Please respond and don…
PDO - best practice
Programming
Web Development
13 Years Ago
by extjac
…) or die("failed!"); while($row = $rs->fetch(
PDO
::FETCH_ASSOC)){ $result[] = $row; } return $result; } } $Account = new account(); // * …) or die("failed!"); while($row = $rs->fetch(
PDO
::FETCH_ASSOC)){ $result[] = $row; } return $result; } } $Account = new account(); // * //…
PDO max_connection with 2 visitors
Programming
Web Development
12 Years Ago
by tacticalweb
… i and my friend visited the website i got from
PDO
(MySQL) the error SQLSTATE[08004] [1040] Too many connections. I… use a Singleton class to manage the
PDO
(so i create only 1
PDO
instance to do the queries). I do… not close the
PDO
(set the
PDO
= null) since i read that the PHP does it…
Re: PDO Query Fatal error:Call to a member function query() on a non-object
Programming
Web Development
10 Years Ago
by Athirah Yusri
…=try', $username, $password); $db->setAttribute(
PDO
::ATTR_ERRMODE,
PDO
::ERRMODE_EXCEPTION); } catch(PDOException $e) { echo &…dbname=try', $username, $password); $db->setAttribute(
PDO
::ATTR_ERRMODE,
PDO
::ERRMODE_EXCEPTION); } catch(PDOException $e) { echo $…
pdo - how to put where clause in while loop
Programming
Web Development
9 Years Ago
by blueguy777
…`where clause variable $didno` in following code: $
pdo
= Database::connect(); $
pdo
->setAttribute(
PDO
::ATTR_ERRMODE,
PDO
::ERRMODE_EXCEPTION); $sql = "SELECT * FROM misscall… WHERE did_no = ?"; $q = $
pdo
->query($sql); $mobile1 = array(); while ($mobi1 = $q->fetchColumn()) …
PDO Sql connection
Programming
Web Development
9 Years Ago
by davy_yg
…quot;root"; $password = ""; try { $conn = new
PDO
("mysql:host=$servername;dbname=twotables", $username, $password); // set… the
PDO
error mode to exception $conn->setAttribute(
PDO
::ATTR_ERRMODE,
PDO
::ERRORMODE_EXCEPTION); echo "Connected successfully&…
Re: PDO error help
Programming
Web Development
12 Years Ago
by rosse88
…=> 'myphpadmin', 'dbname' => 'luminregister' ); try { $dbh = new
PDO
('mysql:host=' . $config['db']['host'] . ';dbname=' . $config['db']['dbname'] .…config['db']['username'], $config['db']['password']); $dbh->setAttribute(
PDO
::ATTR_ERRMODE,
PDO
::ERRMODE_EXCEPTION); } catch(PDOException $e) { die ($e->…
PDO Output Parameter Problem
Programming
Web Development
13 Years Ago
by bharanidharanit
… stmt; DEALLOCATE PREPARE stmt; END But when using with
PDO
am returning this error $c=0; $stmt = $this…count)"); $stmt->bindParam(":count",$c,
PDO
::PARAM_INT|
PDO
::PARAM_INPUT_OUTPUT,0); $stmt->execute(); return $c; PDOException…count ? 2.How to get exact count via
pdo
?
Re: PDO - Classes and Forms
Programming
Web Development
13 Years Ago
by veedeoo
…will be passing this class to our
pdo
object public function show_userInfo(){ ## The following… will be output on the page once the
PDO
statement is fetched. $u_info = ""; $…include_once 'includes/settings.php'; #### The
PDO
objects ############### try { $someDb = new
PDO
("mysql:host=$db_host;dbname=$db_database"…
PDO error help
Programming
Web Development
12 Years Ago
by rosse88
…$dbname = "luminregister"; // connect using
PDO
try { $dbh = new
PDO
("mysql:host=$dbhost;dbname=$dbname", $dbuser…labled tag_name1 through tag_name10). This is the only
PDO
that ive had issues with (my other cascading… is that the prepare() is not calling the
pdo
, but Im almost certain this one is just…
PDO Query Fatal error:Call to a member function query() on a non-object
Programming
Web Development
10 Years Ago
by Athirah Yusri
…=try', $username, $password); $db->setAttribute(
PDO
::ATTR_ERRMODE,
PDO
::ERRMODE_EXCEPTION); } catch(PDOException $e) { echo "…postID' => $row['postID'])); $catRow = $stmt2->fetchAll(
PDO
::FETCH_ASSOC); $links = array(); foreach ($catRow as $cat) {…
PDO Group fetched results by same ID
Programming
Web Development
7 Years Ago
by seularts
…=$dbname", $username, $password); $conn->setAttribute(
PDO
::ATTR_ERRMODE,
PDO
::ERRMODE_EXCEPTION); $stmt = $conn->prepare("SELECT submit_time…resulting array to associative $result = $stmt->setFetchMode(
PDO
::FETCH_ASSOC); foreach(new TableRows(new RecursiveArrayIterator($stmt->fetchAll())) …
Re: pdo normalize mysql table
Programming
Web Development
7 Years Ago
by seularts
…($stmt->rowCount()>0) { while($row=$stmt->fetch(
PDO
::FETCH_ASSOC)) { $date_in = $row['data']; $date_out = explode(' ', $date_in); ?> <…(array(":id"=>$id)); $editRow=$stmt->fetch(
PDO
::FETCH_ASSOC); return $editRow; If I echo `row['limbi_straine']` it…
Re: PDO error help
Programming
Web Development
12 Years Ago
by diafol
Ok, had a look at the
PDO
stuff, and came up with this - just slightly different to … = ""; $dbname = "diafol"; // connect using
PDO
try { $dbh = new
PDO
("mysql:host=$dbhost;dbname=$dbname", $dbuser, $dbpass…
Re: PDO error help
Programming
Web Development
12 Years Ago
by rosse88
…gt; 'myphpadmin', 'dbname' => 'luminregister' ); try { $dbh = new
PDO
('mysql:host=' . $config['db']['host'] . ';dbname=' . $config['db']['dbname'] …['db']['username'], $config['db']['password']); $dbh->setAttribute(
PDO
::ATTR_ERRMODE,
PDO
::ERRMODE_EXCEPTION); } catch(PDOException $e) { die ($e->…
Re: PDO error help
Programming
Web Development
12 Years Ago
by diafol
…; 'myphpadmin', 'dbname' => 'luminregister' ); try { $dbh = new
PDO
('mysql:host=' . $config['db']['host'] . ';dbname=' . $config['db']['dbname']…['db']['username'], $config['db']['password']); $dbh->setAttribute(
PDO
::ATTR_ERRMODE,
PDO
::ERRMODE_EXCEPTION); } catch(PDOException $e) { die ($e-&…
Re: PDO CRUD
Programming
Web Development
12 Years Ago
by Squidge
… $pass, $dbname) { $this->dbh = new
PDO
( "mysql:host=localhost;dbname=$dbname", $user,… $pass, array(
PDO
::ATTR_PERSISTENT => true ) ); } public function query($query…
PDO Number of Total Queries per Page
Programming
Web Development
15 Years Ago
by opatut
…I don't want to count them manually. I use
PDO
for this, so I can't easily write a function… to write my an "myPDO"-class, extended from
PDO
, to do this job, but it didn't work. […CODE=PHP]class myPDO extends
PDO
{ var $myOwnCount =0; public function __construct($location,$user,$pass) { …
Re: PDO Number of Total Queries per Page
Programming
Web Development
15 Years Ago
by opatut
…($location, $user, $pass);[/CODE] If I use
PDO
instead, it works: [CODE]$dataBase = new
PDO
($location, $user, $pass);[/CODE] Functions.php around… support this, but it should because it is extended from
PDO
...
1
2
3
17
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC