Jump to content

Inserting Date into MYSQL database


sonic00

Recommended Posts

I am having some problems inserting data into the database

Can anybody help?

 

$mysqli1 = new mysqli ("localhost", "root","pogo", "bookingsystem");

$stmt = $mysqli1 -> prepare("INSERT INTO booked(bookedID,dateBookedFor,userID,slotID,roomID)

VALUES(?,?,?,?,?)");

//STORE IN VARIABLE

$stmt->bind_param('iisss', 4,FROM_UNIXTIME('$dateBookedOn'),$u, 6,'1001');

$_SESSION['Step'] = "Just before condition";

if($stmt -> execute())

{

$_SESSION['Step'] = "Data inserted succesfully";

echo "true";

}

else

{

$_SESSION['Step'] = "Data failed to be inserted";

echo "existed";

}

 

Link to comment
https://forums.phpfreaks.com/topic/151714-inserting-date-into-mysql-database/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.