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

Problem With PDO?

7 views
Skip to first unread message

Call Me Tom

unread,
Feb 1, 2018, 11:53:57 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?

Call Me Tom

unread,
Feb 1, 2018, 12:49:42 PM2/1/18
to
Message has been deleted

Thomas 'PointedEars' Lahn

unread,
Feb 5, 2018, 7:41:20 PM2/5/18
to
[Supersedes for correction]

Call Me Tom wrote:

> I chose this forum because my sql statements appear to be working.

JFYI: Know where you are posting to. This is a _Usenet_ _newsgroup_, not a
*Web* forum; it is only a forum in the sense of the umbrella term.

> 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.
> […]
> What am I missing?

Error logging, a proper newsreader or more tea (you have posted this 4
times), a real name, and a proper From address¹. IOW, a minimum clue:

<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://php.net/docs.php>

F’up2 poster

________
¹ As noemail.com accepts any “RCPT TO” value, and the Web site merely
arbitrarily redirects, sometimes even to blacklisted sites, I am now
adding it to my killfile list of address mungers. (I will not see
further postings with this second-level domain in the From. You have
been warned.)

<http://www.interhack.net/pubs/munging-harmful/>
--
PointedEars
Zend Certified PHP Engineer <http://www.zend.com/en/yellow-pages/ZEND024953>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.
0 new messages