If you have a filed defined and timestamp in MySQL table and you want to insert or update the field using mysqli binding, you can make use of the now() function of MySQL
Example Insert query:
$query = "INSERT INTO my_table VALUES ('text1',now())";
mysqli_query($mysqli, $query);
Example Update query:
$query = "UPDATE my_table SET $topicId=?, $topicName=?, created_date=now()";
$stmt -> bind_param("ss",$topic_name,$topic_desc);
$stmt -> execute();
$stmt -> close();
More Posts related to PHP,
- PHP Code for sending Emails
- PHP drag and drop file upload tutorial using dropzone.js
- Delete file using PHP code : unlink()
- Save current timestamp in MySQL using PHP mysqi binding
- Failed to load resource: net::ERR_CACHE_MISS PHP
- PHP Warning: Cannot modify header information - headers already sent
- PHP header location function not called
- How to destroy PHP session()
- Upload docx file using PHP script
- Call PHP function on Button click using jquery ajax
- Upload Pdf file using PHP Script
- 403 forbidden error for Image
- PHP Base64 encoding decoding a variable
- PHP 301 Redirect Permanently
- Copy file from one directory to other in Php
- PHP Script to Upload Images to Server
- Installing vue.js in Laravel 8
- PHP Fatal error : Call to a member function bind_param() on a non-object
- PHP.ini: How to Remove URL Forward Slash Before Single or Double Quotes
- macOS - cannot calculate MAC address: Using fd 9 hv_vm_create HV_ERROR [PHP XAMPP]
More Posts:
- MacoOS - xyz is an app downloaded from the internet. Are you sure you want to open it? Alert - MacOS
- Java Check Leap Year - Programs with Code Examples - Java
- Read a file using Java 8 Stream - Java
- How to resolve Certificate Expired WhatsApp Error - WhatsApp
- Add new user in Ubuntu Linux using Terminal Command - Ubuntu
- JSP Hello World Program Tutorial with Eclipse and Tomcat Server - Java
- Unable to edit file in Notepad++ - NotepadPlusPlus
- How to check RAM details on Mac? - MacOS