What's new

Bakit kaya ganito output nya

loktoy

Eternal Poster
Joined
Oct 20, 2014
Posts
1,166
Solutions
2
Reaction
103
Points
496
Age
30
bakit kaya ganito lumabas na output nyan
For all new employees or suppliers who do not yet have a bank account, we need a hard copy of the savings account or payroll account of the bswm employee, but when it is from outside, we need a bank certificate or Letter of Introduction (LOI). Note: For all employees and suppliers, in case you have changed your ATM or last name or your account is closed, please inform us from accounting so that we can update it and we will enter the transaction into the correct account.

na dapat ganito output nya kasi ganito to ininput sa textarea:

For all new employees or suppliers who do not yet have a bank account, we need a hard copy of the savings account or payroll account of the bswm employee, but when it is from outside, we need a bank certificate or Letter of Introduction (LOI).
Note: For all employees and suppliers, in case you have changed your ATM or last name or your account is closed, please inform us from accounting so that we can update it and we will enter the transaction into the correct account.

ito code ko:
dashboard.php
<?php
// end
// Select article in database and ouput
// start
$sql = mysqli_query($con, "SELECT * FROM reminder");
while($row = mysqli_fetch_assoc($sql)){
$reminder = $row['reminder'];
$first_reminder = $row['firstreminder'];
$second_reminder = $row['secondreminder'];
$third_reminder = $row['thirdreminder'];

}

?>
update.php

<?php
include '../config/config.php';
$reminder = $_POST['reminderudate'];
$reminder = mysqli_real_escape_string($con, $_POST['post_content']);
$sql = "UPDATE reminder SET reminder = '$reminder'";
mysqli_query($con, $sql) or die(mysqli_error($con));
header('location:dashboard.php');
exit();
?>
 
Based on the code you provided, it seems like you are trying to update the "reminder" field in the "reminder" table of your database. However, there are a few issues with your code that might be causing the unexpected output.

1. Incorrect Variable Name:
In your update.php file, you have used the variable name "$reminderudate" instead of "$reminder" for assigning the value from the form input. You should update this line:
Code:
$reminder = $_POST['reminderudate'];
to:
Code:
$reminder = $_POST['reminderupdate'];

2. Duplicate Variable Assignment:
You have assigned the value of "$_POST['post_content']" to the variable "$reminder" twice. You only need to assign it once, so you can remove the following line:
Code:
$reminder = mysqli_real_escape_string($con, $_POST['post_content']);

3. Missing WHERE Clause in SQL Query:
In your SQL UPDATE statement, you are missing a WHERE clause to specify which row you want to update. Without the WHERE clause, all rows in the "reminder" table will be updated, which might not be the desired behavior. You should add a WHERE clause to specify the condition for the update. For example, if you have an "id" column in your table, you can update the query like this:
Code:
$sql = "UPDATE reminder SET reminder = '$reminder' WHERE id = $id";
Replace "$id" with the actual id value of the row you want to update.

4. Query Execution Check:
It's also a good practice to check if the query was executed successfully or not. You can use the mysqli_affected_rows() function to check if any rows were affected by the query. If the number of affected rows is greater than 0, it means the update was successful. You can add the following code after executing the query:
Code:
if (mysqli_affected_rows($con) > 0) {
    // Update successful
} else {
    // Update failed
}

Make sure to review and update your code based on these suggestions to see if it resolves the issue with the output.
 
Based on the code you provided, it seems like you are trying to update the "reminder" field in the "reminder" table of your database. However, there are a few issues with your code that might be causing the unexpected output.

1. Incorrect Variable Name:
In your update.php file, you have used the variable name "$reminderudate" instead of "$reminder" for assigning the value from the form input. You should update this line:
Code:
$reminder = $_POST['reminderudate'];
to:
Code:
$reminder = $_POST['reminderupdate'];

2. Duplicate Variable Assignment:
You have assigned the value of "$_POST['post_content']" to the variable "$reminder" twice. You only need to assign it once, so you can remove the following line:
Code:
$reminder = mysqli_real_escape_string($con, $_POST['post_content']);

3. Missing WHERE Clause in SQL Query:
In your SQL UPDATE statement, you are missing a WHERE clause to specify which row you want to update. Without the WHERE clause, all rows in the "reminder" table will be updated, which might not be the desired behavior. You should add a WHERE clause to specify the condition for the update. For example, if you have an "id" column in your table, you can update the query like this:
Code:
$sql = "UPDATE reminder SET reminder = '$reminder' WHERE id = $id";
Replace "$id" with the actual id value of the row you want to update.

4. Query Execution Check:
It's also a good practice to check if the query was executed successfully or not. You can use the mysqli_affected_rows() function to check if any rows were affected by the query. If the number of affected rows is greater than 0, it means the update was successful. You can add the following code after executing the query:
Code:
if (mysqli_affected_rows($con) > 0) {
    // Update successful
} else {
    // Update failed
}

Make sure to review and update your code based on these suggestions to see if it resolves the issue with the output.
mali pa rin po ito po sana gusto ko mafix

bakit kaya ganito lumabas na output nyan
For all new employees or suppliers who do not yet have a bank account, we need a hard copy of the savings account or payroll account of the bswm employee, but when it is from outside, we need a bank certificate or Letter of Introduction (LOI). Note: For all employees and suppliers, in case you have changed your ATM or last name or your account is closed, please inform us from accounting so that we can update it and we will enter the transaction into the correct account.

na dapat ganito output nya kasi ganito to ininput sa textarea:

For all new employees or suppliers who do not yet have a bank account, we need a hard copy of the savings account or payroll account of the bswm employee, but when it is from outside, we need a bank certificate or Letter of Introduction (LOI).
Note: For all employees and suppliers, in case you have changed your ATM or last name or your account is closed, please inform us from accounting so that we can update it and we will enter the transaction into the correct account.

ito code ko:
dashboard.php
<?php
// end
// Select article in database and ouput
// start
$sql = mysqli_query($con, "SELECT * FROM reminder");
while($row = mysqli_fetch_assoc($sql)){
$reminder = $row['reminder'];

}

?>
 
mali pa rin po ito po sana gusto ko mafix

bakit kaya ganito lumabas na output nyan
For all new employees or suppliers who do not yet have a bank account, we need a hard copy of the savings account or payroll account of the bswm employee, but when it is from outside, we need a bank certificate or Letter of Introduction (LOI). Note: For all employees and suppliers, in case you have changed your ATM or last name or your account is closed, please inform us from accounting so that we can update it and we will enter the transaction into the correct account.

na dapat ganito output nya kasi ganito to ininput sa textarea:

For all new employees or suppliers who do not yet have a bank account, we need a hard copy of the savings account or payroll account of the bswm employee, but when it is from outside, we need a bank certificate or Letter of Introduction (LOI).
Note: For all employees and suppliers, in case you have changed your ATM or last name or your account is closed, please inform us from accounting so that we can update it and we will enter the transaction into the correct account.

ito code ko:
dashboard.php
<?php
// end
// Select article in database and ouput
// start
$sql = mysqli_query($con, "SELECT * FROM reminder");
while($row = mysqli_fetch_assoc($sql)){
$reminder = $row['reminder'];

}

?>
Based on the code you provided, it seems like you are retrieving the "reminder" field from the "reminder" table and storing it in the variable "$reminder". However, you are not outputting the value of "$reminder" anywhere in your code. To display the desired output, you need to echo/print the value of "$reminder" inside your HTML markup.

Here's an updated version of your code that includes the necessary echo/print statement:

PHP:
<?php
// end
// Select article from the database and output
// start
$sql = mysqli_query($con, "SELECT * FROM reminder");
while($row = mysqli_fetch_assoc($sql)){
    $reminder = $row['reminder'];
    echo $reminder; // Output the value of $reminder
}
?>

Make sure to place the echo/print statement in the appropriate location within your HTML markup to display the value of "$reminder" in the desired output format.

Also, please note that the code you provided does not show the complete picture, and there might be other parts of your code that could affect the output. If the issue persists, please provide more details or the full code so that I can assist you further.
 

Similar threads

Back
Top