Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with PDO?

13 views
Skip to first unread message

Call Me Tom

unread,
Feb 1, 2018, 1:17:06 AM2/1/18
to
I chose this forum because my sql statements appear to be working.

The logged user has all privileges on the database.
The $numin echo prints 2555 which is the number of rows in the table.
The table test is unchanged after running the file.
Here's the code.

<?php

require_once('./includes/mysql_connect.php');

$query = "SELECT report_id,fsacars_rep_url
FROM test";

$result=$dbh->query($query);
$numin=$result->rowCount();
echo "$numin";
while($url_orig=$result->FETCH(PDO::FETCH_NUM)) {
$report_id = $url_orig[0];
$url_trim = substr($url_orig[1],34);
$url_new = 'http://localhost/CAA' . $url_trim;

$sql="UPDATE test
SET fsacars_rep_url = $url_new
WHERE report_id = $report_id";
$dbh->exec($sql);
}

What am I missing?

careenj...@gmail.com

unread,
Mar 13, 2018, 6:29:41 AM3/13/18
to
In addition to setting the error code, PDO will emit a traditional E_WARNING message. This setting is useful during debugging/testing, if you just want to see what problems occurred without interrupting the flow of the application.Exception mode is also useful because you can structure your error handling more clearly than with traditional PHP-style warnings, and with less code/nesting than by running in silent mode and explicitly checking the return value of each database call.
https://www.besanttechnologies.com/training-courses/data-warehousing-training/big-data-hadoop-training-institute-in-bangalore
0 new messages