Bug #77906 [NEW]: Update feature not working
| From: | lynnehorne at gmail dot com | Date: | Tue, 16 Apr 2019 13:02:30 +0000 |
| Subject: | Bug #77906 [NEW]: Update feature not working | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-220476@lists.php.net to get a copy of this message | ||
From: lynnehorne at gmail dot com
Operating system: Windows 10
PHP version: 7.2.17
Package: *General Issues
Bug Type: Bug
Bug description:Update feature not working
Description:
------------
I am running on Windows 10 with MySQL Community Server edition and PHP
7.3.3 using Xampp Apache. I have also rolled back to PHP 7.3.2 and 7.2,
without success. When I run the code to update any of the information
from my tables, I don't get any error message in the browser (Firefox,
Chrome and Explorer) but the database does not update.
Test script:
---------------
function update(){
$query = "UPDATE
" . $this->table_name . "
SET
city = :city,
provinceid = :provinceid,
countryid = :countryid
WHERE
id = :id";
$stmt = $this->conn->prepare($query);
// posted values
$this->city=htmlspecialchars(strip_tags($this->city));
$this->provinceid=htmlspecialchars(strip_tags($this->provinceid));
$this->countryid=htmlspecialchars(strip_tags($this->countryid));
$this->id=htmlspecialchars(strip_tags($this->id));
// bind parameters
$stmt->bindParam(':city', $this->city);
$stmt->bindParam(':provinceid', $this->provinceid);
$stmt->bindParam(':countryid', $this->country_d);
$stmt->bindParam(':id', $this->id);
// execute the query
if($stmt->execute()){
return true;
}
return false;
}
Expected result:
----------------
I expect to see that the data in my database has updated with the
changes.
Actual result:
--------------
Nothing happens. I just get the message from my code that the database
is not updated.
--
Edit bug report at https://bugs.php.net/bug.php?id=77906&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77906&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77906&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77906&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=77906&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=77906&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=77906&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=77906&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=77906&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=77906&r=support
Expected behavior: https://bugs.php.net/fix.php?id=77906&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=77906&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=77906&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=77906&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77906&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=77906&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=77906&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=77906&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77906&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=77906&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=77906&r=mysqlcfg