how do i send all item id at once through url success.php?id=

As i add some items in the cart i cant change the status in the database from “ADDED TO CART ” to “CONFIRMED”

<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<?php
require 'includes/common.php';

if (!isset($_SESSION['email']))
{
    header('location: index.php');
}
?>
<html>
    <head>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" >
    <!--jQuery library--> 
    https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js
    <!--Latest compiled a>
        <meta charset="UTF-8">nd minified JavaScript--> 
    https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js
    <link href="style.css" rel="stylesheet" type="text/css"/>
        <title>Lifestyle Store | Products</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
    <body >
          <?php
        include 'includes/header.php';
        ?>
        <?php
        $user_id=$_SESSION['id'];
        //changed from above user_id to $_getc ['user_id']
        $items_query="SELECT items.id,items.name,items.price from items INNER JOIN user_items INNER JOIN users ON items.id=user_items.item_id AND user_items.user_id=users.id WHERE user_items.user_id= $user_id AND user_items.status='Added To Cart'";
        
        // chaged from select * from user_items inner join items on user_items.item_id=items.id where items.id=$user_id";
        
        $items_query_result= mysqli_query($con, $items_query) or die(mysqli_error($con));
        
        
        
        ?>
        
       
       
        
       <?php  if (mysqli_num_rows($items_query_result)==0){ ?> 
       <?php echo 'Add something in cart';  }  else  { ?>
        
</div> </div> <?php }?> <?php include 'includes/footer.php'; ?> </body> </html>
  1. this is the code for a shopping cart
  2. user add some this in the cart
  3. **then when the user goes to the cart the cart displays all the items with their ids, name and the price **
  4. and finally the total price
  5. **i have defined a while loop to sum up the price and to display the id name etc **
  6. now i want to send the item id to the success.php to change the status in the database from "Added To Cart " to "Confirmed"
Source: stackoverflow-php

Why its not displaying current time zone?

I am trying to add parameter in query which passes indian time zone to mysql database server.But when i am passing this query it shows 0000-00-00 00:00:00 in my table.
I am using hostinger php my admin database server.
Please help me to solve this.

<?php


include 'confi.php';

 date_default_timezone_set('Indian/Maldives');

    $email = isset($_POST['email']) ? mysqli_real_escape_string($conn,$_POST['email']) : "";
    $today = date("d/m/Y h:i:s A");

    $sql ="INSERT INTO `i_order` (`ID`, `email`,`date`) VALUES (NULL, '$email', '$today');"; 

    $qur = mysqli_query($conn,$sql);
    if($qur){
        $json = array("status" => 1, "msg" => "success!");
    }else{
        $json = array("status" => 0, "msg" => "error!");
    }

@mysqli_close($conn);

/* Output header */
    header('Content-type: application/json');
    echo json_encode($json);


?>


Source: stackoverflow-php

MySQL / SQL PHP Error [duplicate]

This question already has an answer here:

$sql = "INSERT INTO website (id, username, password, email, timestamp, balance, rank, banned, color, ts3, minecraft, 'ip')VALUES ('', '$username', '$pwsalt', '$email', '$timestamp', '0', '1', '0', 'black', 'unknown', 'PedoBear', '$ip')";

Result:

Error: INSERT INTO website (id, username, password, email, timestamp, balance, rank, banned, color, ts3, minecraft, ‘ip’)VALUES (”, ‘FlareCO’, ‘ilovepokemongoeveryday’, ‘admin@customdomain.co’, ‘1492769557’, ‘0’, ‘1’, ‘0’, ‘black’, ‘unknown’, ‘Pikachu’, ‘125.558.95.254’)
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 ”ip’)VALUES (”, ‘FlareCO’, ‘ilovepokemongoeveryday’, ‘admin@customdomain.co’, ‘1492769557’ at line 1

What i need to fix ?


Source: stackoverflow-php

php/sql – Insert Data into Table with PHP (Bootstrap Form, if that makes a difference)

Bottom line: I don’t know what the hell I’m doing. I just want this comment box to submit information to my database. Let me show you what I got.

<form method="POST" action="post.php" style="font-
 size:200%;padding:50px">
<label for="comments">Comments:</label>
<textarea class="form-control" placeholder="How can I improve?" 
 style="background-color:#fff4c9;border-radius:15px;width:100%;" 
 name="comments" rows="5" id="comments" value=""></textarea> <br>
<button type="submit" class="btn btn-default">Share Your Ideas</button>
</form>`

and then my php i guess????

<?php
if($_SERVER["REQUEST_METHOD"] == "POST") {
$servername = "localhost";
$username = "id1403626_wp_4764008ac42f7398450c24184e47c38a";
$password = "Marshall2";
$dbname = "id1403626_wp_257ecd760342ffcefce424435ed4e776";
//Collect Value of Input Field
$name = $_POST['comments'];
$timestamp = date('Y-m-d H:i:sa');

//Create connection
$connect = mysqli_connect($servername, $username, $password);

//Check connection
if ($connect->connect_error) {
die("So here's the problem...:".$connect->connect_error);
}
//Select Database
mysqli_select_db($connect,$dbname)
or die("Whoops! Can't find that pesky database!");
//Insert Data Query
$sql = "INSERT INTO `Comments`(`comments`, `date`) VALUES ($name, 
$timestamp)";
//What should happen
$result = mysqli_query($connect, $sql);

if($result){
echo 'thank you for your feed back';
}else {
echo "Fuck man I can't code this shit right. If you have a comment email 
it to me at philobythekilo@gmail.com I'ma get this shit working one of 
these days.";
}
}
?>

I just cannot find what I am doing wrong. Help a sista out, please!


Source: stackoverflow-php