How to store post details and timestamp in database?

How to store post details and timestamp in database?

Content Index :

How to store post details and timestamp in database?
Tag : php , By : JackIT
Date : November 23 2020, 09:01 AM

hop of those help? If the poster id is a session you have got it correct
Couple user guide links will be use full.

class Post_model extends CI_Model {

public function add_post() {

$data = array(
      'id' => $this->session->userdata('id'),
      'username' => $this->input->post('username'),
      'post' => $this->input->post('post')

$this->db->insert($this->db->dbprefix . 'posts');


public function edit_post() {

$data = array(
     'username' => $this->input->post('username'),
     'post' => $this->input->post('post')

$this->db->where('id', $this->session->userdata('id'));
$this->db->update($this->db->dbprefix . 'posts');


class Welcome extends CI_Controller {

   public function __construct() {

   public function index() {
      $this->form_validation->set_rules('post', 'Post');

      if ($this->form_validation->run() == FALSE) {


      } else {

         // $this->post_model->add_post();
         // Or
         // $this->post_model->edit_post();




No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

best way to store database details php

Tag : php , By : CrookedNumber
Date : March 29 2020, 07:55 AM
it should still fix some issue Yes, make connecting params like constants or defines, and store in confing as Tomdarkness said.

Android MySQL Php application trying to store user details using post statements in php

Tag : php , By : DonMac
Date : March 29 2020, 07:55 AM
wish helps you There are some errors and notices in your script output and you have the xdebug extension which is trying to make them look pretty by wrapping them in HTML.
You can check your server's php error log or maybe try to copy this and paste it into a HTML file (with a little luck you might be able to read it).

HTTP 500 Error but does store data to database - Wordpress new-post.php, post.php, edit-post.php not working after updat

Tag : php , By : nhuser
Date : March 29 2020, 07:55 AM
To fix the issue you can do It turns out it was the update of WooCommerce 3.0.3 which broke the full site down.. Have downgraded again and am now reading how to migrate properly.. Apparently this was a Major upgrade at which they have moved to a new "CRUD" -method, basicly adding another layer between website and database..
Scroll down on this site below untill you see the part about: Upgrading to 3.0 https://woocommerce.wordpress.com/2017/04/04/say-hello-to-woocommerce-3-0-bionic-butterfly/

How to store username and password details from my app to my database and how to connect my app with my database?

Tag : java , By : eastcoastj
Date : March 29 2020, 07:55 AM
it helps some times You can refer to the sqlite database tutorials to store the data into the database. If you are storing the data in the database that is in the server, then also see the tutorials on connecting to the server database using any volley or retrofit etc.
Always its better dont store password in the text format, hash it with the hashing algorithm like SHA256, MD5 etc and then store it.

Extracting details from a database timestamp

Tag : php , By : Ricardo
Date : March 29 2020, 07:55 AM
Related Posts Related QUESTIONS :
  • How to search a row that has been joined with another table
  • How to do mysql LEFT JOIN for Google multiple line chart (php, mysql)?
  • Find the two longest strings separated by dash in PHP
  • Cannot access private property with Set method in Symfony
  • How to compare 2 array of PHP objects then fill in empty string if data not match?
  • strtotime gives back false result to strings in an array
  • How to create Url that contain name and id laravel
  • Codeigniter: Models not working with an error: Undefined property: CI_Loader
  • How to use + or - operators as parameters in Doctrine prepared SQL statement?
  • How to run scrapy with url parameters from php on linux debian
  • Preg matching imgur.com links
  • Php - Code comparing value of database to the value send by android app
  • Laravel pagination object in javascript
  • Error in validating message of no votes PHP
  • Symfony site on Azure with ClearDB connection
  • Woocommerce upsell with checkboxes
  • How to login/logout with Hybridauth 3?
  • Convert INT number in PHP
  • php/mysql. selecting 2 common fields in 2 tables
  • Expand an string based on values in an array in PHP
  • When you absolutely have to manually escape SQL in CakePHP 3.4.7
  • Htaccess redirecting wrong page
  • Laravel Optional WHERE clause
  • PHP unpack overlfow variable memory limit
  • How to check the URL's structure using PHP preg_match?
  • PHP preg_replace - text will not be recognized
  • Show image from other domain without showing the domain name - PHP
  • How to run and watch local server at the same time?
  • Access form request from Observer laravel
  • single quote problem with preg_replace_callback
  • How to Create A Unique URL for each product enquiry form for Google Analytics Tracking
  • Laravel email configuration: what am I missing?
  • Assign indexed array values to multidimensional array?
  • Custom WordPress stylesheet not loading
  • Data attribute only returning first value
  • How to list all roles with Permissions,in spatie permission Package?
  • How to achieve this number pattern with n input
  • How to iterate array inside array data in laravel ,output are given below
  • To get output of movie with its genre
  • Extracting some data from a JS object literal string in PHP using Regex
  • axios and vuex are deleting wrong index in array
  • Setting empty CURLOPT_POSTFIELDS
  • Laravel 5.8 use subdomain as API endpoint beside domain.com/api
  • Error while add data in database SQL Server 2016
  • Does PhpStorm allow to skip PHPDoc tags when type hints is declared?
  • html classes are changed to Attributes
  • Using json to import multidimensional data
  • passing data from the view to the controller, where the data comes from another controller
  • How to extract integer and decimal numbers in PHP string correctly?
  • Parsing Sub-Object from an XML Feed with objects
  • Getting error "Unknown column 'text' in 'field list'"
  • How to properly get onedrive access token via php and curl
  • How to add spell check to a php function
  • Is it posible to create css rules with php?
  • Pretty URL with $_GET method
  • Wordpress always load same page - index.php
  • Find value in array and return with new from different array
  • PHP multiple file upload with different keys
  • Can't modify times one a time without weird errors
  • Get size of scraped image with domcrawler (Goutte)
  • shadow
    Privacy Policy - Terms - Contact Us © scrbit.com