Try concatenation to fix the problem with $_POST, eg:
PHP:
<?php
"UPDATE aduankerosakan SET status = '" . $status . "' WHERE idAduan = '" . $_POST['id'] . "' "
?>
To get the error, you need to test for $result == false in your custom query function, ie:
PHP:
<?php
if ($result == false && ini_get('display_errors') == 1)
?>
I'm sorry but I have to point this out...
empty(), a language construct, checks for false, null, empty string, zero and string 0 values, so... empty($value) is just like saying if $value==false
Second, concatenation, will produce identical output to the curly brace syntax used. Curly syntax in a nutshell just tells PHP that, when delimiting a variable within a string with curly braces to drop out of normal string parsing mode and treat that object like a varible, which is handy for including nested multidimensional arrays and objects within a string.
References:
http://www.php.net/empty
http://www.php.net/manual/en/language.types.string.php
Just FYI guys.
Apek,
First a bit of advice,
You include a file in each of your scripts...
<?php
include("../inc/config.php");
?>
Why don't you place the query() function in that file... then it is always available and you don't have to cut and paste it.
Second:
Your inclusion of this form tag:
<form name="myform">
Is without both an action and method attribute.
on semakAduan.php AND in semakAduan1.php
action tells the browser where to send the data from the form, and method tells the browser how to send the data, as a query string appended to a url (the GET method) or invisibly behind the scenes (the POST method).
For your application I would reccomend using the POST method.
So in: semakAduan.php
modify the form tag to say the following:
<form name="myform" action='semakAduan1.php' method='post'>
Then in 'semakAduan1.php' your may access data from 'semakAduan.php' in the PHP $_POST superglobal array.
Ok, my next question is where is the HTML input field to post the data to the second page? Or the query string? You have no code that produces a way to transfer this value to the other page.
$_POST["id"]
Would reference an HTML input field by the same name...
Perhaps a hidden field?
<input type='hidden' name='id' value='' />
You would place the hidden field between the <form> tags in 'semakAduan.php', and place the needed value in the value='' attribute.
If I understand what I'm seeing properly that outght to be of help.
Also, <? ?> known as short tags are not a good habit to get into. These can be deactivated in php.ini, and are not XML compliant. For the sake of portability and just plain ole good programming practice, use <?php ?>, which is XML compliant and gauranteed portable.
: )
Rich