Posts

Showing posts with the label mysql

How To Become The Showtime Give-And-Take Of A String/Sentence Inwards Php?

There is a string business office ( strtok ) which tin hold upwards used to separate a string into smaller strings ( tokens ) based on unopen to separator(s). For the purposes of this thread, the offset give-and-take (defined equally anything earlier the offset infinite character) of  Test me more  can hold upwards obtained by  tokenizing  the string on the infinite character. <? php $value = "Test me more" ; echo strtok ( $value , " " ); // Test ?> For to a greater extent than details in addition to examples, meet the  strtok PHP manual page . Alternative solutions $myvalue = 'Test me more' ; echo strstr ( $myvalue , ' ' , true ); // volition impress Test echo current(explode(' ',$myvalue)); // volition impress Test $myvalue = 'Test me more'; $arr = explode(' ',trim($myvalue)); echo $arr[0]; // volition impress Test $string = ' Test me to a greater extent than '; preg_match('/\b\w+\b/i'...

How To Update A Joined Tables Using Codeigniter's Active Record?

Codeigniter active tape doesn't let to update a joined tables. After trying diverse method as well as searching the solution, I accept institute the next solution which does the precisely same affair i.e. update the multiple bring together tables. By using next method, you lot tin update multiple tabular array using codeigniter active record. $this->db->set('a.firstname', 'Pekka'); $this->db->set('a.lastname', 'Kuronen'); $this->db->set('b.companyname', 'Suomi Oy'); $this->db->set('b.companyaddress', 'Mannerheimtie 123, Helsinki Suomi'); $this->db->where('a.id', 1); $this->db->where('a.id = b.id'); $this->db->update('table every mo a, table2 every mo b'); Sumber http://developer-paradize.blogspot.com

Jquery Fullcalendar Integration Amongst Php In Addition To Mysql

Image
This plugin is to practise a comprehensive interactive calendar that looks similar "Google Calendar". And to perform basic operations on events (display, add, edit) dynamically through AJAX requests, it too allows to easily manipulate the diverse elements via "drag & drop". fig: Screen dump of output Step1 : Download the jQuery fullcalendar plugin past times here You involve to grab the required scripts too css. You tin abide by what y'all involve to become far piece of occupation past times looking at default.html file. The plugin comes amongst a exhibit files to examination the calendar: the advert of the folder is "Demos". Do non hesitate to explore all the files too accept a await at the source code of each page to sympathise the differences. Step 2 : Create database called 'fullcalendar' too practise tabular array called 'evenement' CREATE TABLE `evenement` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` var...

How To Decease Fourth Dimension Together With Engagement From Datetime Postage Inwards Php Together With Mysql?

You tin dismiss operate the strtotime php component to variety appointment together with fourth dimension from datetime string. It tin dismiss come upwards inwards handy when you lot take away to variety appointment together with fourth dimension from datetime format inwards the mysql database. $datetime = '2013-08-14 11:45:45'; echo date("Y-m-d",strtotime($datetime)); // output 2013-08-14 echo date("H:i:s",strtotime($datetime)); // output 11:45:45 Small together with uncomplicated solution. :) Sumber http://developer-paradize.blogspot.com

How To Empty Or Truncate Mysql Tabular Array Using Codeigniter Active Record?

If you lot desire to empty or truncate a mysql tabular array using Codeigniter active record, role the next code. To empty $this->db->empty_table(); This volition generate a delete SQL string too runs the query. // DELETE FROM mytable To truncate $this->db->from('mytable'); $this->db->truncate(); // or $this->db->truncate('mytable'); This volition generate a truncate SQL string too runs the query. // TRUNCATE mytable Source: http://www.learnhow2do.com/computer/internet/2013/04/13/learn-how-to-empty-or-truncate-table-using-codeigniter-active-record/ Sumber http://developer-paradize.blogspot.com

When As Well As How To Run Indexes Inward Mysql ?

Image
This comes upwardly inward discussions almost every novel projection I piece of employment on, because it's a real of import affair to visit when designing a database. When deciding when together with how to create an index inward your MySQL database, it's of import to visit how the information is beingness used. Let's nation you lot receive got a database of employees. We volition create it similar this: CREATE TABLE employees ( ID INT, advert VARCHAR(60), salary decimal(10,2), engagement hired(date) ) So you lot volition notice that this tabular array is pretty simplistic, together with doesn't genuinely incorporate all the information you lot would require to genuinely contend employees, but its only for the sake of demonstration, together with you lot could e'er add together to a greater extent than later, or fifty-fifty brand unopen to other tabular array together with piece of employment joins if you lot had genuinely complex needs. For straightaway...

How To Rename Or Modify Mysql Database Name?

Image
You tin easily alter or rename your database advert using mysql interface. Steps 1. Goto http://www.example.com/phpMyAdmin 2. Select database which you lot desire to rename. 3. Goto functioning tab in that place you lot volition honour input champaign to rename database. 4. Rename the database as well as press 'Go' as well as its done. Sumber http://developer-paradize.blogspot.com

How To Charge Json Information Amongst Jquery, Php Together With Mysql ?

This shipping shows how to populate a pick out box based on the value of the another, past times getting JSON information amongst jQuery from a PHP script that gets the information from a MySQL database. HTML Code The initial HTML code looks similar this: <form> Fruit: <select name="name" id="fruitName"> <option>Apple</option> <option>Banana</option> <option>Orange</option> <option>Pear</option> </select> Variety: <select name="variety" id="fruitVariety"> </select> </form> The laid of fruit names was already populated on the server-side as well as the default laid of varieties could endure too; I convey chosen to populate them amongst Javascript inwards this example. jQuery Code The jQuery code needs to initially populate the diverseness drib downwardly based on the value of the fruit drib down. It as...

How To Capture Array Values From Dynamic Input Fields Using Php?

In my previous post , y'all were able to add together multiple dynamic fields using jQuery. In this tutorial, nosotros volition collect values from those dynamically generated input fields, which tin give notice live on displayed on user browser or shop inwards MySql database. Let's assume y'all induce got a HTML shape amongst multiple input fields similar event shown below. This fields are generated past times jQuery code inwards my previous post . <form method="post" action="collect_vals.php"> <div class="input_fields_wrap"> <button class="add_field_button">Add More Fields</button> <div><input type="text" name="mytext[]"></div> <div><input type="text" name="mytext[]"></div> <div><input type="text" name="mytext[]"></div> <div><input type="text" name="mytext[]...

How To Upgrade Mysql/Phpmyadmin Inwards Mamp?

Image
Follow these elementary steps to upgrade phpMyAdmin or Mysql inward MAMP. The latest version was phpMyAdmin 4.2.10.1 (at the fourth dimension of writing). 1. Download the latest version from http://www.phpmyadmin.net/home_page/index.php 2. Unpack the archive yous simply downloaded, the resulting folder should hold upward called somewhat similar "phpMyAdmin-x.y-all-languages" 3. Rename "/Applications/MAMP/bin/phpMyAdmin" to "/Applications/MAMP/bin/phpMyAdmin-OLD" 4. Copy "phpMyAdmin-x.y-all-languages" to "/Applications/MAMP/bin/" 5. Rename "/Applications/MAMP/bin/phpMyAdmin-x.y-all-languages" to "/Applications/MAMP/bin/phpMyAdmin" 6. Restart the MAMP in addition to upgrading chore is completed. You convey successfully upgraded to latest phpMyAdmin or Mysql 4.2.10.1 version. What is phpMyAdmin? phpMyAdmin is a complimentary software tool written inward PHP, intended to grip the direction of MySQL over the W...

Custom Full-Text Search Against Stopwords Too Particular Characters Using Php Too Mysql

I'm non certain if this is the best way. To construct clean I expire the information through this class, all it does is strip out whatsoever especial characters, together with a listing of halt words that I don't desire to include inwards searches: <?php shape Cleaner { var $stopwords = array(" detect ", " well-nigh ", " me ", " e'er ", " each ", " update ", " delete ", " add together ", " insert ", " where ", " i ", " a ", " my ");//you quest to extend this big time. var $symbols = array('/','\\','\'','"',',','.','<','>','?',';',':','[',']','{','}','|','=','+', '-','_',')','(','*','&','^','%','$...

How To Perform Multiple Tags Search Inquiry Using Php, Mysql & Codeigniter?

I working on a tag based search. I accept 3 tables tag(id,name), tagXmedia(id,tag_id,media_id), as well as media(id,...). tagXmedia is the mapping tabular array betwixt the tag as well as media tables. This is a 1 to many relationship. For illustration I require to live on able to search for an entry inwards the media tabular array that is associated amongst both the "home" as well as "hawaii" tags. SELECT media_id FROM tagXmedia WHERE tag_id IN (SELECT id FROM tag WHERE get upwards IN ('home','hawaii')) GROUP BY media_id HAVING COUNT(tag_id) = 2; If y'all want to accept it agree to a greater extent than than but 2 tags, y'all tin easily add together them. Just retrieve to alter the 2 inwards the HAVING clause. Perform Multiple Tags Search using URL Parameters as well as Codeigniter Within the enquiry string, parameters (filters) are separated past times ampersands (&), as well as multiple values per parameter are separated past...

How To Display Search Results Amongst Multiple Tags Using Codeigniter Active Record?

Image
I was working on a tags organization inward CI and, what I require was to generate a interrogation that should entirely display posts alongside selected tags (i.e. entirely that accept the tags) equally an output. After searching many hours inward internet, I saw this amazing weblog alongside possible solutions. http://tagging.pui.ch/post/37027745720/tags-database-schemas Because of my database struture, i liked "Toxi Solution". The primary payoff of this solution is that it is to a greater extent than normalized than the other solutions, together with that you lot tin hand notice accept unlimited pose out of tags per post. Since I require to entirely exhibit posts that accept the tags. So I accept to produce Intersection (AND) query. Intersection (AND) Query for “bookmark+webservice+semweb” SELECT b.* FROM tagmap bt, bookmark b, tag t WHERE bt.tag_id = t.tag_id AND (t.name IN ('bookmark', 'webservice', 'semweb')) AND b.id = bt.bookmar...