hey guys im facing problem in using webix form here is a code snipet of existing form
.dataform{ padding:10px; border:1px solid pink; border-radius:10px; width:300px; margin-left:500px; margin-top: 100px;}
.dataform2{
padding:10px;
border:1px solid pink;
border-radius:10px;
width:300px;
margin-left:500px;
margin-top: 100px;
}
.formheading{
background-color:red;
color:white;
padding:4px;
text-align:center;
}
.sub{
background-color:red;
padding: 7px 40px 7px 40px;
color:white;
font-weight:bold;
margin-left:70px;
border-radius:5px;
}
table, th, td {
border: 1px solid black;
}
A small example page to insert some data in to the MySQL database using PHP
DATE | |
OB | |
ORE | |
STOCKPILE | |
Enter the date you like to display the data from MySQL:
<?php
$servername = "localhost";
$username = "root";
$password = "root";
$dbname = "myDB";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$sql = "INSERT INTO dashboard (date, ob, ore, stkpl)
VALUES ('$_POST[date]','$_POST[ob]','$_POST[ore]','$_POST[sp]')";
if (mysqli_query($conn, $sql)) {
echo "New record created successfully
";
} else {
// echo "Error: " . $sql . "
" . mysqli_error($conn);
}
mysqli_close($conn);
?>
<?php
$servername = "localhost";
$username = "root";
$password = "root";
$dbname = "myDB";
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$date = $_POST['date'];
$sql = "select * from dashboard where date = '$date'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
echo "
your results
"; echo ""; while($row = $result->fetch_assoc()) { echo "" ; } echo"OB | ORE | STOCKPILE |
---|---|---|
".$row["ob"]." | ".$row["ore"]." | ".$row["stkpl"]." |
here im connecting to data base retriveing data and displaying on the screen how to use webix form insted of html form with same functionality. with form method as post