Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #17684 > unrolled thread

Problem With PDO?

Started byCall Me Tom <noemail@noemail.com>
First post2018-02-01 12:49 -0500
Last post2018-02-06 01:41 +0100
Articles 2 — 2 participants

Back to article view | Back to comp.lang.php


Contents

  Problem With PDO? Call Me Tom <noemail@noemail.com> - 2018-02-01 12:49 -0500
    Re: Problem With PDO? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-02-06 01:41 +0100

#17684 — Problem With PDO?

FromCall Me Tom <noemail@noemail.com>
Date2018-02-01 12:49 -0500
SubjectProblem With PDO?
Message-ID<2ok67dtmgck421h2oai92ol0sffogcqjn8@4ax.com>
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?

[toc] | [next] | [standalone]


#17690

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2018-02-06 01:41 +0100
Message-ID<101200569.nniJfEyVGO@PointedEars.de>
In reply to#17684
[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.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web