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,
- Delete file using PHP code : unlink()
- PHP header location function not called
- 403 forbidden error for Image
- Call PHP function on Button click using jquery ajax
- How to Pretty Print JSON in PHP
- Step-by-Step Guide: How to Fix - Error Establishing a Database Connection in WordPress
- PHP Base64 encoding decoding a variable
- 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
- PHP drag and drop file upload tutorial using dropzone.js
- Upload Pdf file using PHP Script
- PHP Warning: Cannot modify header information - headers already sent
- macOS - cannot calculate MAC address: Using fd 9 hv_vm_create HV_ERROR [PHP XAMPP]
- PHP Code for sending Emails
- How to destroy PHP session()
- Installing vue.js in Laravel 8
- PHP 301 Redirect Permanently
- Upload docx file using PHP script
- Save current timestamp in MySQL using PHP mysqi binding
- Copy file from one directory to other in Php
- Failed to load resource: net::ERR_CACHE_MISS PHP
- PHP Script to Upload Images to Server
More Posts:
- Fix Error - Another active Homebrew update process is already in progress - MacOS
- Removing a key from Python Dict - Python
- How to replace   with space - HowTos
- 3 Examples to read a text file line by line using java - Java
- macOS: Remove Desktop or Documents Folder from iCloud Drive Syncing - MacOS
- JDBC SQLException Statement.executeQuery() cannot issue statements that do not produce result sets - Java
- [Fix] Access Denied - GoDaddy Website Firewall - IP Blocked - HowTos
- PowerShell 1..10 foreach Example - Powershell