What's new

Bakit ganito error ko

loktoy

Eternal Poster
Joined
Oct 20, 2014
Posts
1,168
Solutions
2
Reaction
103
Points
497
Age
30
nag uupdate ako kapag maiksi is pumapasok sya pero kapag mahaba na o ito nilagay ko

all new employees or suppliers who do not have a bank account, we need a hard copy of the savings account or payroll account of the bswm employee, but if it is from outside, we need a bank certificate or Letter of Introduction (LOI). How first you can get a bank certificate, just go to the bank assigned to your account and then just request a bank certficate, I don't know if it's free or not, then you'll give us the xerox copy. Second, LOI is free, but to be processed, it needs to be filled out by the owner of the supplier, then he will go to the bank to validate that the owner entered correctly...

nag error na:
Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 't know if it's free or not, then you'll give us the xerox copy. Second, LOI i...' at line 1 in C:\xampp\htdocs\Innerjoin\admin\reminderupdate.php:7 Stack trace: #0 C:\xampp\htdocs\Innerjoin\admin\reminderupdate.php(7): mysqli_query(Object(mysqli), 'UPDATE reminder...') #1 {main} thrown in C:\xampp\htdocs\Innerjoin\admin\reminderupdate.php on line 7
ito code ko:

<?php
include '../config/config.php';
$reminder = $_POST['reminderudate'];
$reminder = $_POST['post_content'];
mysqli_query($con, "UPDATE reminder SET reminder ='$reminder'") or die (mysqli_error($con));
header('location:dashboard.php');
exit();
?>
 
Ang error na iyong nakikita ay nagmumula sa syntax error sa iyong SQL query. Nagkamali ka sa pag-gamit ng single quotes sa loob ng query. Upang maayos ito, dapat mong isalansan ang single quotes sa loob ng iyong query. Narito ang tamang code:

PHP:
<?php 
include '../config/config.php';
$reminder = $_POST['reminderupdate'];
$reminder = $_POST['post_content'];

$sql = "UPDATE reminder SET reminder = '$reminder'";
mysqli_query($con, $sql) or die(mysqli_error($con));

header('location:dashboard.php');
exit();
?>

Sa code na ito, ginamit natin ang variable $sql upang maglagay ng SQL query. Matapos ang pag-update ng reminder field, ginamit natin ang mysqli_query function upang maipatupad ang query. Kung may error na nagyari sa pag-update, gagamitin ang mysqli_error function upang maipakita ang detalye ng error.

Tandaan na maaaring magkaroon ka rin ng ibang mga error sa code mo. Siguraduhin mong mayroon kang maayos na database connection at tama ang mga pangalan ng mga form input fields.
 
Ang error na iyong nakikita ay nagmumula sa syntax error sa iyong SQL query. Nagkamali ka sa pag-gamit ng single quotes sa loob ng query. Upang maayos ito, dapat mong isalansan ang single quotes sa loob ng iyong query. Narito ang tamang code:

PHP:
<?php
include '../config/config.php';
$reminder = $_POST['reminderupdate'];
$reminder = $_POST['post_content'];

$sql = "UPDATE reminder SET reminder = '$reminder'";
mysqli_query($con, $sql) or die(mysqli_error($con));

header('location:dashboard.php');
exit();
?>

Sa code na ito, ginamit natin ang variable $sql upang maglagay ng SQL query. Matapos ang pag-update ng reminder field, ginamit natin ang mysqli_query function upang maipatupad ang query. Kung may error na nagyari sa pag-update, gagamitin ang mysqli_error function upang maipakita ang detalye ng error.

Tandaan na maaaring magkaroon ka rin ng ibang mga error sa code mo. Siguraduhin mong mayroon kang maayos na database connection at tama ang mga pangalan ng mga form input fields.
ganito pa rin error na lumalabas
Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 't know if it's free or not, then you'll give us the xerox copy. Second, LOI i...' at line 1 in C:\xampp\htdocs\Innerjoin\admin\reminderupdate.php:7 Stack trace: #0 C:\xampp\htdocs\Innerjoin\admin\reminderupdate.php(7): mysqli_query(Object(mysqli), 'UPDATE reminder...') #1 {main} thrown in C:\xampp\htdocs\Innerjoin\admin\reminderupdate.php on line 7
 
ganito pa rin error na lumalabas
Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 't know if it's free or not, then you'll give us the xerox copy. Second, LOI i...' at line 1 in C:\xampp\htdocs\Innerjoin\admin\reminderupdate.php:7 Stack trace: #0 C:\xampp\htdocs\Innerjoin\admin\reminderupdate.php(7): mysqli_query(Object(mysqli), 'UPDATE reminder...') #1 {main} thrown in C:\xampp\htdocs\Innerjoin\admin\reminderupdate.php on line 7
Ang error na iyong nakikita ay nagmumula sa quotes na ginagamit sa loob ng iyong query. Dahil mayroon kang quotes sa loob ng iyong query, ito ay nagreresulta sa syntax error.

Upang maayos ito, kailangan mong i-escape ang quotes sa loob ng iyong query. Gamitin ang function na mysqli_real_escape_string() upang gawin ito. Narito ang iyong naayos na code:

PHP:
<?php
include '../config/config.php';
$reminder = $_POST['reminderupdate'];
$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();
?>

Sa code na ito, ginamit natin ang mysqli_real_escape_string() function upang i-escape ang mga special characters, tulad ng mga quotes, sa loob ng $reminder variable bago ito isama sa query. Ito ay nagbibigay ng proteksyon laban sa SQL injection.

Pakitiyak na tama ang pangalan ng column sa iyong UPDATE query at mayroon kang maayos na database connection. Kung mayroon ka pa ring problema, paki-tsek ang mga detalye ng error na ibinibigay ng mysqli_error().
 
Ang error na iyong nakikita ay nagmumula sa quotes na ginagamit sa loob ng iyong query. Dahil mayroon kang quotes sa loob ng iyong query, ito ay nagreresulta sa syntax error.

Upang maayos ito, kailangan mong i-escape ang quotes sa loob ng iyong query. Gamitin ang function na mysqli_real_escape_string() upang gawin ito. Narito ang iyong naayos na code:

PHP:
<?php
include '../config/config.php';
$reminder = $_POST['reminderupdate'];
$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();
?>

Sa code na ito, ginamit natin ang mysqli_real_escape_string() function upang i-escape ang mga special characters, tulad ng mga quotes, sa loob ng $reminder variable bago ito isama sa query. Ito ay nagbibigay ng proteksyon laban sa SQL injection.

Pakitiyak na tama ang pangalan ng column sa iyong UPDATE query at mayroon kang maayos na database connection. Kung mayroon ka pa ring problema, paki-tsek ang mga detalye ng error na ibinibigay ng mysqli_error().
sa database po anu maganda gamitin na type kasi po kapag ginagawa ko sya VARCHAR(500) napuputol yun output at pati dun sa pagpasok sa database di narerecord yun mga last part
 
sa database po anu maganda gamitin na type kasi po kapag ginagawa ko sya VARCHAR(500) napuputol yun output at pati dun sa pagpasok sa database di narerecord yun mga last part
Kung ang iyong nilalaman ay sobrang haba para sa VARCHAR(500), maaaring gusto mong gamitin ang ibang data type sa iyong database table. Narito ang ilang mga opsyon na maaaring mong subukan:

1. TEXT - Ang data type na ito ay ginagamit para sa mahabang mga teksto na hindi mo alam kung gaano kahaba. Ito ay walang limitasyon sa haba ng data na maaaring maipasok.

2. MEDIUMTEXT - Katulad ng TEXT, ang MEDIUMTEXT ay ginagamit para sa mahabang mga teksto. Ito ay may mas malaking limitasyon sa haba kaysa sa TEXT.

3. LONGTEXT - Ito ang pinakamalaking data type para sa mga mahabang mga teksto. Ito ay angkop para sa mga napakahabang strings at hindi ito may limitasyon sa haba.

Halimbawa, kung nais mong gamitin ang TEXT data type, maaari mong baguhin ang column type sa iyong database table gamit ang ALTER TABLE command. Narito ang isang halimbawa ng pagbabago ng data type gamit ang ALTER TABLE:

SQL:
ALTER TABLE reminder MODIFY COLUMN reminder TEXT;

Kapag ginawa mo ito, ang column type ng "reminder" ay magiging TEXT, na magbibigay-daan sa iyo na maglagay ng mas mahabang mga teksto sa database.

Tandaan na pagpalit ng data type ay maaaring maka-apekto sa iyong mga kasalukuyang data, kaya't siguraduhin mong mag-backup muna bago mo ito gawin.
 
Kung ang iyong nilalaman ay sobrang haba para sa VARCHAR(500), maaaring gusto mong gamitin ang ibang data type sa iyong database table. Narito ang ilang mga opsyon na maaaring mong subukan:

1. TEXT - Ang data type na ito ay ginagamit para sa mahabang mga teksto na hindi mo alam kung gaano kahaba. Ito ay walang limitasyon sa haba ng data na maaaring maipasok.

2. MEDIUMTEXT - Katulad ng TEXT, ang MEDIUMTEXT ay ginagamit para sa mahabang mga teksto. Ito ay may mas malaking limitasyon sa haba kaysa sa TEXT.

3. LONGTEXT - Ito ang pinakamalaking data type para sa mga mahabang mga teksto. Ito ay angkop para sa mga napakahabang strings at hindi ito may limitasyon sa haba.

Halimbawa, kung nais mong gamitin ang TEXT data type, maaari mong baguhin ang column type sa iyong database table gamit ang ALTER TABLE command. Narito ang isang halimbawa ng pagbabago ng data type gamit ang ALTER TABLE:

SQL:
ALTER TABLE reminder MODIFY COLUMN reminder TEXT;

Kapag ginawa mo ito, ang column type ng "reminder" ay magiging TEXT, na magbibigay-daan sa iyo na maglagay ng mas mahabang mga teksto sa database.

Tandaan na pagpalit ng data type ay maaaring maka-apekto sa iyong mga kasalukuyang data, kaya't siguraduhin mong mag-backup muna bago mo ito gawin.
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: If 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 insert the transaction into the correct account.

bakit kaya hindi sya bumaba yun Note:
dumugtong sya..

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'];

}

?>

ito code ko sa
 
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: If 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 insert the transaction into the correct account.

bakit kaya hindi sya bumaba yun Note:
dumugtong sya..

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'];

}

?>

ito code ko sa
Sa iyong code, hindi mo inilalabas ang nilalaman ng "Note" field. Upang maipakita ito sa output, kailangan mo itong idagdag sa iyong code ng HTML. Narito ang naayos na code:

PHP:
<?php 
    // Select article in database and output
    $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'];
        $note = $row['note'];
    }
?>

<!DOCTYPE html>
<html>
<head>
    <title>Dashboard</title>
</head>
<body>
    <!-- Output reminder -->
    <h1>Reminder: <?php echo $reminder; ?></h1>
    <p>First Reminder: <?php echo $first_reminder; ?></p>
    <p>Second Reminder: <?php echo $second_reminder; ?></p>
    <p>Third Reminder: <?php echo $third_reminder; ?></p>
    
    <!-- Output note -->
    <p>Note: <?php echo $note; ?></p>
</body>
</html>

Sa naayos na code, idinagdag natin ang variable $note para makuha ang nilalaman ng "note" field mula sa database. Pagkatapos, idinagdag natin ito sa HTML output gamit ang <?php echo $note; ?> upang maipakita ito sa pahina.

Siguraduhin na ang column name na "note" ay tama at eksakto sa iyong database table. Kung hindi, baguhin ang pangalan ng column sa code depende sa iyong setup.
 
Sa iyong code, hindi mo inilalabas ang nilalaman ng "Note" field. Upang maipakita ito sa output, kailangan mo itong idagdag sa iyong code ng HTML. Narito ang naayos na code:

PHP:
<?php
    // Select article in database and output
    $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'];
        $note = $row['note'];
    }
?>

<!DOCTYPE html>
<html>
<head>
    <title>Dashboard</title>
</head>
<body>
    <!-- Output reminder -->
    <h1>Reminder: <?php echo $reminder; ?></h1>
    <p>First Reminder: <?php echo $first_reminder; ?></p>
    <p>Second Reminder: <?php echo $second_reminder; ?></p>
    <p>Third Reminder: <?php echo $third_reminder; ?></p>
   
    <!-- Output note -->
    <p>Note: <?php echo $note; ?></p>
</body>
</html>

Sa naayos na code, idinagdag natin ang variable $note para makuha ang nilalaman ng "note" field mula sa database. Pagkatapos, idinagdag natin ito sa HTML output gamit ang <?php echo $note; ?> upang maipakita ito sa pahina.

Siguraduhin na ang column name na "note" ay tama at eksakto sa iyong database table. Kung hindi, baguhin ang pangalan ng column sa code depende sa iyong setup.
lumabas naman sya kaso ito 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 :

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.
 

Similar threads

Back
Top