Closed v917 closed 7 years ago
ok, problem solved.
Sorry for not being able to attend your issue, I was too busy with the university.
😢
ohh its totally fine. Don't be sad
@creptor but now I am having another problem that, it is showing the message "Setting was updated" but it is not actually updating it. So, whenever you'll be free then please resolve my issue. Till then I am moving forward to next video. queries.php: https://pastebin.com/PciCyMKi settings: https://pastebin.com/Yn37iXGN Doc1.docx
I think that this:
$q = "UPDATE settings SET id = '$_POST[id]', label = '$label', value = '$value' WHERE id = '$_POST[openedid]'";
Should be:
$q = "UPDATE settings SET id = '$_POST[id]', label = '$label', value = '$value' WHERE id = '$_POST[id]'";
But I have used <input type="hidden" name="openedid" vaule="<?php echo $opened['id']; ?>" />
in settings.php
, that is why it is '$_POST[openedid]'
Try changing this:
if(isset($_POST['id']) != '') {
With:
if(isset($_POST['openedid'])&&$_POST['openedid']!='') {
No it is not working. See here:
And sorry for disturbing you in your busy schedule.
Now, I am having similar problem in navigation link ( part - 85) as well. It is also showing updating message but not actually updating it.
I am not able to move forward now.😢 Please Help @creptor if you are free.
Please add this to the top of the file (inside setup.php would do fine) to try to find an error:
error_reporting(E_ALL);
ini_set("display_errors", 1);
If there's any error, it should be output as text. Check the console, the might be found behind elements with styles.
Nothing happened 😢
Can you take a photo of the database structure? To find out if the query is wrong...
DatabaseScreenshots.docx Check it Now
If you need this one as well then please check.
pages
and users
link are updating the page and user respectively, but navigation
and settings
are creating the problem, don't know why
can you please put the query for the pages and users here?
Also you could try with this query: ´´´ $q = 'UPDATE settings SET id = '.$_POST['id'].', label = '.$label.', value = '.$value.' WHERE id = '.$_POST['openedid']; ´´´
After changing what you said to do, this happened:
And queries for pages and users are: https://pastebin.com/WK6Nj3Pn
I want to ask one thing that:
<input type="hidden" name="openedid" vaule="<?php echo $opened['id']; ?>" />
$q = 'UPDATE settings SET id = '.$_POST['id'].', label = '.$label.', value = '.$value.' WHERE id = '.$_POST['openedid'];;
here in input tag openedid is the name and and in the query i am searching id = '$_POST[openedid]'
, So is it correct?
Try changing the query to this:
$q = 'UPDATE settings SET id = `'.$_POST['id'].'`, label = `'.$label.'`, value = `'.$value.'` WHERE id = `'.$_GET['id'].'`';
The
$_POST['openedid']
is not being set correctly, so this will fall back to the id sent by the URI.
ok. Wait
here in input tag openedid is the name and and in the query i am searching id = '$_POST[openedid]', So is it correct?
Could you please rephrase that, I didn't understand 😢 .
Nothing happened again
Sorry, I think it was the other way around, try this:
$q = "UPDATE settings SET `id` = '".$_POST['id']."', ´label´ = '".$label."', ´value´ = '".$value."' WHERE ´id´='".$_GET['id']."'";
o/p:
can you check if the input that is hidden with the value ´openedid´ has the same value as the id one?
It can be done with the developer console
queries.php https://pastebin.com/RG0FPDB3 settings.php https://pastebin.com/gNxzGWRx pages.php https://pastebin.com/Q2iuw2Sq
ok, wait.
yes @creptor the input that is hidden with the value ´openedid´ is same as the id.
This might be the one, it looks similar to the above one, but I was using the Latin keyboard, so the symbols where invalid
on US machines 🤦♂️ , check if it now works:
$q = "UPDATE settings SET `id` = '".$_POST['id']."', ´label´ = '".$label."', ´value´ = '".$value."' WHERE ´id´='".$_POST['openedid']."'";
If it doesn't work, try to place the input openedid
before the submit button......
ok wait
no, again... same error...
could you please insert this query in queries.php
because I think it's again your latin keyboard.
Is ´
correct ? because i have not seen ´
before.. Is it coming from your latin keyboard or you actually wanted to use this?
.-. ok this should be correct (I actually copied the symbol so.... yea):
$q = "UPDATE settings SET `id` = '".$_POST['id']."', `label` = '".$label."', `value` = '".$value."' WHERE `id`='".$_POST['openedid']."'";
Is ´ correct ? because i have not seen ´ before.. Is it coming from your latin keyborad or you actually wanted to use this?
Yea, that thing is confusing as fuck if you want to use it 👎
Note: After this, the problem should be elsewhere if it persists.
but this query is same as you gave before
ok leave 😢. And thank you so much for your help. Really thanks a lot.
that's the thing, nothing that I have found in your script was wrong, so you need to patch the errors or better called 'inconsistencies' to see if it starts working. If I'm not mistaken you should use the symbol ``` for enclosing table names, so there's that.
For example, instead of:
if(isset($_POST['id']) != '') {
You should actually use:
if(isset($_POST['id'])&&$_POST['id']!='') {
Wait, I can actually create another code to make it work, but it will be different. I use other things that are more.... advanced? any way, I can't explain to you how the code will work that's the catch, but it would be basically the same thing and it should work.
I will make it tomorrow if you tell me the credentials that you're using for the database:
Example: user: root, password: ,host: (localhost?),port: (3306?)
You have told me to use if(isset($_POST['id'])&&$_POST['id']!='')
before but it didn't work. And I told you about that. And thanks for doing so much for me.
ok wait.
user: Dev password: password1 host: localhost port: 80
Is that what you are asking?
I need the information of the database, port 80 is used for web interface.
what you have inside of the file database.php
(or connection.php
), if you want you can email it to me to keep it secret... this is my email: creptor@live.com
ok
I have mailed you. Please tell me if i have send you exactly what you are asking or not.
yes it's correct 👍 I'll email you the solution when I finish it 😋
ok, Thank you so much in advance
Hi, @creptor actually the label textboxes in
setting.php
are not displaying the text which is in database, instead it is displaying Label. Please Help.settings: https://pastebin.com/npgQdZrA queries.php: https://pastebin.com/7dRuvqgB Label problem.docx