No DB UPDATE on hosting server |
Post Reply |
Author | |
Dmit OE
Admin Group Joined: May 31 2012 Status: Offline Points: 5283 |
Post Options
Thanks(1)
Posted: Oct 31 2016 at 4:17pm |
So access permissions for DB files were insufficient.. Ok
|
|
djju1029
Senior Member Joined: Aug 02 2016 Location: the US Status: Offline Points: 126 |
Post Options
Thanks(0)
|
I resolved this issue with change the mode as following:
pi@raspberrypi:~/Project/NMU_mockup/Data/Local_previs_DB $ chmod 777 illu.db pi@raspberrypi:~/Project/NMU_mockup/Data/Local_previs_DB $ chmod 777 oedb.db Thank you for your support!
|
|
djju1029
Senior Member Joined: Aug 02 2016 Location: the US Status: Offline Points: 126 |
Post Options
Thanks(0)
|
I got this message.
This error (HTTP 500 Internal Server Error) means that the website you are visiting had a server problem which prevented the webpage from displaying.
|
|
djju1029
Senior Member Joined: Aug 02 2016 Location: the US Status: Offline Points: 126 |
Post Options
Thanks(0)
|
Here is the sample code. (update.php - This code works in LocalHost, not in Raspberry Pi)
<?php //registerng by form $data = array(); $data[0] = $_POST['WE50467f8358']; $data[1] = $_POST['WEd7e0a2dcba']; $data[2] = $_POST['WE778b0b2dec']; //open DB $db = new PDO('sqlite:../../Data/Local_previs_DB/illu.db'); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); //read DB $readstmt = $db->prepare("SELECT * FROM test_table"); $readstmt->execute(); $read = $readstmt->fetchAll(PDO::FETCH_ASSOC); $tempid = array(); for ($i=0; $i<=2; $i++) { if ($data[$i] !== $read[$i]['name']) { $tempid[$i] = $read[$i]['id']; } } //update DB $updatestmt = array(); for ($ii=0; $ii<=2; $ii++) { if ($tempid[$ii] !== NULL) { $updatestmt[$ii] = $db->prepare("UPDATE test_table SET name=(:name) WHERE id='$tempid[$ii]'"); $updatestmt[$ii]->bindParam(':name', $data[$ii]); $updatestmt[$ii]->execute(); } } header('Location: ./test-BlankLayer.php'); ?> Edited by djju1029 - Oct 31 2016 at 11:46am |
|
djju1029
Senior Member Joined: Aug 02 2016 Location: the US Status: Offline Points: 126 |
Post Options
Thanks(0)
|
Thanks for feedback, Dmit OE.
No error message, just no updating and last value remained.
|
|
Dmit OE
Admin Group Joined: May 31 2012 Status: Offline Points: 5283 |
Post Options
Thanks(1)
|
P.S. Give your code's piece that contains UPDATE
|
|
Dmit OE
Admin Group Joined: May 31 2012 Status: Offline Points: 5283 |
Post Options
Thanks(1)
|
Does it show any error message? Can you try to write(or copy from some tutorial) a small script that updates a table, and see what happens?
|
|
djju1029
Senior Member Joined: Aug 02 2016 Location: the US Status: Offline Points: 126 |
Post Options
Thanks(0)
|
Dear OE Team,
Very Urgent issue, I tested all functions on LocalHost test evironment and copied by FTP client to my webserver in Raspberry Pi machine. But after copying source, only DB UPDATE function does not work. The other function such as OPEN, SELECT DB work but UPDATE didn't. Still, all functions are working on LocalHost by OE 1.56 and sources are exactly same. Do you know what problem is on mine?
Edited by djju1029 - Dec 07 2016 at 2:32pm |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |