CodeAndCoins Forum

Official Forum of YouTube/CodeAndCoins Channel

Any problem, other than on a youtube video.
#71
<?php

$servername = "localhost:3308";
$username = "root";
$password = "";
$dbname = "chocorangups";

// Create Connection
$conn = new mysqli ($servername, $username, $password, $dbname);
// Check Connection
if ($conn->connect_error)
{
die("Connection failed: " . $conn->connect_error);
}

//Arahan SQL (Structure Query Language)

//$ContohSQL = "DELETE FROM tbl_choco WHERE cust_address = '".$_REQUEST['txtModfield2']."' ";

//Arahan SQL (Structure Query Language)

//$ContohSQL = "UPDATE tbl_choco SET cust_name = 'Mohd Ali', cust_address = 'kota bharu' WHERE cust_id = '1' ";

$ContohSQL = "UPDATE tbl_choco SET cust_name = '".isset($_POST['txtModfield1'])."',cust_address = '".isset($_POST['txtModfield2'])."', phone_num = '".isset($_POST['txtModfield3'])."', type = '".isset($_POST['txtModfield4'])."', quantity= '".isset($_POST['txtModfield5'])."', WHERE cust_id = '".$_GET['custid']."' ";


//Dapatkan hasil pencarian
$hasilQuery = $conn->query($ContohSQL);
echo "Data sudah di update";
//Mengesahkan query
if(!$hasilQuery)
{
//Amaran jika gagal
echo "Query Failed: " . mysql_error();
exit;
}

?>

This may be happen because of mix matching the cod[…]

sorry, can I ask one last question? why this err[…]

Intro

Hi, I'm Jef. I've been living in Thailand for the […]

If browser return php code, that means php code is[…]