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?