MySQL query to append character to each entry
Scenario: You want to append a string or character at the beginning of a db field. solution: UPDATE Tablename SET Username = Concat(‘0’, Username);
Scenario: You want to append a string or character at the beginning of a db field. solution: UPDATE Tablename SET Username = Concat(‘0’, Username);
Scenario: You have a field in database where you want to add it all with a number for example: 1000; you can update all of them like this: UPDATE mysql_table SET user_id = 1000 + user_id;
Everyone, who worked with Jstree’s may face to this question: How to get the checked Ids of Jstree in form submit? here is the solution: <script type=”text/javascript> function submitMe() { var checked_ids = []; $(‘#your-tree-id’).jstree(‘get_checked’,null,true).each(function(){ checked_ids.push(this.id); }); //setting to hidden field document.getElementById(‘jsfields’).value = checked_ids.join(“,”); } </script> <input type=”hidden” name=”jsfields” id=”jsfields” value=”” />
I needed this simple code tonight, I tried many ways, but this one worked perfectly. It firstly closes your popup window, and refresh the parent page then. //close popup window and refresh the parent window function CloseAndRefresh() { window.close(); if (window.opener && !window.opener.closed) { window.opener.location.reload(); } } You can use it like this: <input type=”button” …
I am really happy to write these sentences for a great news of being the first MSP of Afghanistan after passing a period of 1 year as MSP in Turkey. You may start to ask, what is this MSP, so here is the answer: What is MSP? The Microsoft Student Partners (MSP) is a worldwide …
SELECT * FROM TABLE WHERE HOUR(time) BETWEEN 1 AND 2; This query brings all records between 1 and 2 o’clock according to time field of you table. (time = The DB field which you save the time)
I recently had a problem regarding this issue in my blog (WordPress 3.3). The problem occured when I wanted to upload an image to one of posts. When trying to upload the image, the following error occured: Unable to create directory /home/jamshidh/public_html/wp-content. Is its parent directory writable by the server? After some searchs regarding this …
You can detect HTTPS with the code line below in PHP if (!isset($_SERVER[‘HTTPS’]) || $_SERVER[‘HTTPS’] != ‘on’) { //Your code here }
1) Create upload.php file inside controller, copy and past the following code into. Also create an ‘uploads’ folder inside the codeigniter root folder. <?php //Author: Jamshid HASHIMI class Upload extends CI_Controller { function __construct() { parent::__construct(); $this->load->helper(‘form’); $this->load->helper(‘url’); } function index() { $this->load->view(‘upload_view’); } //Upload Image function function uploadImage() { $config[‘upload_path’] = “uploads/”; $config[‘allowed_types’] = …