w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Unserialize MySQL field into outfile
you can not do it with mysql MySQL doesn't know what a PHP serialization is. You can't do it. you should have to make php serialization to do with your csv files

Categories : PHP

saving from select into outfile mySQL onto client computer
On Mac OSX, files in the /tmp directory are hidden in the finder. You could try this to show hidden files in the finder.

Categories : Mysql

Highcharts not being drawn in some cases when using data from MySQL (page elements created before database query complete?) PHP / MySQL
Here ya go... $('#container').highcharts({ data: { table: document.getElementById('datatable') }....//other chart details.... <table id="datatable"> <thead> <tr> <th></th> <th>Jane</th> <th>John</th> </tr> </thead> <tbody> <tr> <th>Apples</th> <td>3</td> <td>4</td> </tr> <tr> <th>Pears</th> <td>2</td> <td>0</td> </tr> <tr> <th>Plums</th> <td>5</td> <td>11</td> </tr> <tr> <th>Bananas</th> <td&g

Categories : PHP

How to bind MySQL data to dynamically created Form Elements
lets assume $edit=true, means it is in edit mode. then you php code will be.. assuming you have ever set different <?php $query = $dhb->prepare("SELECT * FROM table2 WHERE $col = ?"); $query->execute(array($id)); $index = array(); $value = array(); $amt = $query->rowCount(); $rows = $query->setFetchMode(PDO::FETCH_NUM); while($z = $query->fetch()){ print_r($z); $index[] = $z[0]; $value[$z[0]] = $z[1]; } ?> and you html code will be... <?php if($edit && is_array($index) && is_array($value)){ $flagForNewField = false; for ($i=0;$i<6;$i++){ if(in_array($i,$index){ ?> <div id="hold"> <input type="text" name="slinks<?php echo $i; ?>" value="<?php ec

Categories : PHP

MYSQL Deduplicate and remove the duplicate row with least data
This is easy with mysql's multiple-table delete syntax: delete b from mytable a join mytable b on a.email = b.email and a.id != b.id where a.name is not null and a.surname is not null

Categories : Mysql

How to remove all the non numeric characters from column in mysql in bulk data
I assume you're doing something like: update myTable set foo = NumericOnly(foo); I don't know how much better you can do than that. One thing that might help a bit, though. In that NumericOnly function, they're doing extra work. I'd remove the SET idx = LENGTH(val)+1; line, since all that will do is start checking the end of the string (the parts we've already checked) again. A string with 5 leading non-numerics would be checked, in full, 5 times. Removing the line would leave: DROP FUNCTION IF EXISTS NumericOnly; CREATE FUNCTION NumericOnly (val VARCHAR(255)) RETURNS VARCHAR(255) BEGIN DECLARE idx INT DEFAULT 0; IF ISNULL(val) THEN RETURN NULL; END IF; IF LENGTH(val) = 0 THEN RETURN ""; END IF; SET idx = LENGTH(val); WHILE idx > 0 DO IF IsNumeric(SUBSTRING(val,id

Categories : Mysql

How to disable OUTFILE and INFILE?
The user permissions for FILE relate to LOAD DATA/INFILE/INTO OUTFILE type operations: "The FILE privilege gives you permission to read and write files on the server host using the LOAD DATA INFILE and SELECT ... INTO OUTFILE statements and the LOAD_FILE() function. A user who has the FILE privilege can read any file on the server host that is either world-readable or readable by the MySQL server.... Using REVOKE to control FILE privs, from mysql CLI: #change to mysql system db use mysql; #use the REVOKE (opposite of GRANT) to disable any FILE operations #in all dbs for the specific user/host. use % to block all hosts. REVOKE FILE on *.* FROM 'specificuser'@'specifichostname'; Alternatively, if you run into issues, you can selectively GRANT the FILE operations on speci

Categories : Mysql

Trying to write a specific result to a new outfile
You did not tell Perl where to print: print OUTFILE "Average values of genome, gag, pol and env: "; BTW, together with use strict, also use warnings. And for working with files, use lexical filehandles and the three argument form of open: open my $FH, '>', $filename or die $!; print $FH 'Something'; close $FH or die $!;

Categories : Perl

select into outfile not working with hibernate
Use executeUpdate() method to run queries that doesn't return any results. In your case since the results will be dumped to a external file there will be no result set. Note that this is different than a query that may return empty results due to the criteria not being met. EDIT : Since that also seem to be failing I think you may need to try using pure JDBC. Do something like below session.doWork(new Work() { @Override public void execute(Connection con) throws SQLException { //run your query natively here } });

Categories : Java

Write delimited strings from an infile to an outfile
I've done something like this in the past and it worked pretty well... I'm sure it will be more accurate than trying to parse with regex. from HTMLParser import HTMLParser class ImageFinder(HTMLParser): def __init__(self): HTMLParser.__init__(self) self.file = open('output.txt', 'w') def handle_starttag(self, tag, attrs): if tag == "img": url = [u[1] for u in attrs if u[0] == "src"][0] self.file.write(url+" ") def __exit__(self): self.file.close() inputdata = open("myfile.txt").read() parser = ImageFinder() parser.feed(inputdata)

Categories : Python

Oracle SELECT INTO OUTFILE, what's wrong with this query?
SELECT ... INTO OUTFILE is MySQL-specific syntax. It won't work on other DBMSs such as Oracle. In Oracle you would surround the statement with SPOOL filename...SPOOL OFF.

Categories : Oracle

How do I remove a DIV I created using JQuery
Probably you creating multiple elements with the same id. If you have multiple elements with class thumbImage by clicking on them you create element with id tempMenu after them. Maybe you should remove id from created element and call removing like this: $(".thumbImage").mouseout(function(e){ $(this).next(".thumbMenu").remove(); return false; }); Also you can create your div like this: var myDiv = $("<div/>", { "class" : "thumbMenu", text : "THE MENU IS HERE", "visibility": "visible", "left": xCoord-30, "top" : yCoord-30 }) $(this).after(myDiv); Link to the documentation

Categories : Jquery

Way to remove localstorage created by JavaScript in C#
Use this code, ScriptManager.RegisterStartupScript(this, GetType(), "YourUniqueScriptKey", "localStorage.removeItem(key);", true); note: local storage is a client side and C# is serverside. so simple you cannot access client side items with c#. but in above code it will run a javascript code in the first page load after your c# event.

Categories : C#

WPF: How to remove textbox created dynamically
You can find that textbox from the container using Name like: TextBox tb = (TextBox) this.someStackPanel.FindName("Temp"); then later tb.Text = "Test"; To remove it you can do: //First find the TextBox TextBox tb = (TextBox) this.someStackPanel.FindName("Temp"); //Then remove it this.someStackPanel.Children.Remove(tb);

Categories : C#

remove an element created with jquery
Not sure if you want to remove the $self and $selfWrap or just trying to unwrap the div that he wrapped. Try using .parent() to remove the $self and $selfWrap, $self.parent().remove()

Categories : Javascript

How to remove elements once it was created by jquery
You have to use :last, not :last-child ( the <br> element is the last child ): $('.remove_upload_image').on('click', function(){ $('.upload_image input:last').remove(); }); You should probably remove the <br> element as well: $('.remove_upload_image').on('click', function(){ var el = $('.upload_image input:last'); el.add(el.next('br')).remove(); }); FIDDLE

Categories : Javascript

remove namespace from childnode created element
Remarkable, like usual 30 seconds after I post something I figure it out. And in this case it makes no sense. By specifying a namespace, the createelement effectively removes the namespace. XmlElement SpecificVersionElement = refNode.OwnerDocument.CreateElement("SpecificVersion","http://schemas.microsoft.com/developer/msbuild/2003"); SpecificVersionElement.InnerText = "False"; refNode.AppendChild(SpecificVersionElement); Of course this is probably hidden somewhere deep in a MSDN article

Categories : C#

Remove specific shapes created using paperJS
According to paperjs documentation path has an remove() method which removes the path from your paperjs document And as you hold all your items (paths) in arrays, it's relatively easy to remove them from the canvas. Here's an example javascript snippet which will remove all items in given array: function removeItems(items) { var len = items.length; while(--len < -1) { // remove item from the document using paperjs method items[len].remove(); // also remove the item from our own array items.splice(len, 1); } } http://jsfiddle.net/PLzDC/3/ here's an fiddle which shows how to remove all rectangles when you draw an circle (it removes them on mouseUp) Edit: snippet to remove items only having a given name from given array function removeItems(it

Categories : Javascript

How to fadeout and remove elements created by ng-repeat
Start from AngularJS 1.1.4, the ngAnimate directive is added to support the animation. You can achieve it like this: <ul ng-repeat="message in messages" ng-animate="'animate'"> <li>{{message.message}}</li> </ul> And this is the css needed: .animate-enter-setup, .animate-leave-setup { -webkit-transition: 1s linear all; /* Safari/Chrome */ -moz-transition: 1s linear all; /* Firefox */ -ms-transition: 1s linear all; /* IE10 */ -o-transition: 1s linear all; /* Opera */ transition: 1s linear all; /* Future Browsers */ } .animate-enter-setup { opacity: 0; } .animate-enter-setup.animate-enter-start { /* The animation code itself */ opacity: 1; } .animate-leave-setup { opacity: 1; } .animate-leave-setup.animat

Categories : Javascript

WiX v3.7 - How to remove file in uninstall that was created after installation
One way is to define the problem out of existence by installing those files. That is, create and install an empty log file and a dat file—initialized to whatever empty or default is for it. Another way is to put RemoveFile elements under the Component element that is most closely associated with the use those files (e.g., the program exe). Are you sure you want writable files in the same directory as the program? Usually, programs are installed so that only administrators can change them. If the program uses data that any user can change to affect all users, the data would be stored under the ALLUSERS profile. And, data that a user can change that affects only that user would be stored under that user's profile. When data is stored that way, it is a question as to when or even whet

Categories : Wix

Remove dynamically created textbox using jquery
you need to make the variables available in other functions. If you create a variable within the canvas' click function, those vars are only available within this click function. Decline the variables outside the click function or make them global: $("#canvas").click(function(e){ var offset = $(this).offset(); $("#position").text((e.clientX - offset.left) + ", " + (e.clientY - offset.top)); $("#position").empty(); var input = $("<input type='text' value='' class='addtext' id='addText'>"); var save = $("<input type='button' class='save' value='save' id='save'>"); var discard = $("<input type='button' class='discard' value='discard' id='disc'>"); $("#position").

Categories : Javascript

remove translucent bar in navigation bar created with storyboard
Add this to viewDidLoad on the first view controller appearing on the navigation stack: self.navigationController.navigationBar.tintColor = [UIColor whiteColor]; self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;

Categories : Iphone

Remove elements created dynamically in colorbox
$(document).on('click', "a.remove", function() { remove_id = $(this).data('id'); $('#'+remove_id).remove(); }); Use this.. $(this).data('id') already contains 'final_'. Dont need to append it again

Categories : Jquery

remove button for dynamically created form fields
In your table structure to make the form, the anchor element to remove the fieldset is not placed inside the table. So when it is placed into the DOM, the remove link will be outside of the table (the parent element to be removed). http://jsfiddle.net/SG7fG/1/ $(document).ready(function(){ var wrapper = $("#wrapper"); var addForm = $("#add-form"); var index = 0; $("#myForm").validate({ errorPlacement: function(error, element) { error.insertAfter(element); //$(element).next().after(error); //error.appendTo( element.parent().next() ); }, rules: {} //rules }); //validate() var getForm = function(index, action) { //returns set of form fields as a string

Categories : Jquery

Sencha: remove dynamically created components using CSS class
Did you try with removeNode or with destroy ?

Categories : Extjs

CSS3 transition doesn't work when I remove class of newly created element
Because you're removing the class before the screen calculates the redrawing of elements. You're removing it before it's shown as that class in the first place, so it doesn't think an animation is necessary. The timeout makes it so it "waits" 0 milliseconds and then removes the class, which lets it show the element with the class first, "wait" 0 time and then remove the class.

Categories : Javascript

Backup of mysql DB not being created
I was getting the WMI exception you mention trying to make a new server instance under the "Server Administration" of mysql's "Workbench Central". I had been trying "Take Parameters from Existing Database Connection" and choosing my local DB when I got the exception. In that first "Specify the Host Machine the Database Server is running on" screen, I needed to choose the first option, "localhost". This let me create a connection to my local server through which I could import data that I had exported from another database. The export was made into a flat .sql file. You might try simply exporting to a .sql file and then putting that file on a CD.

Categories : Mysql

Adding columns you created in mysql?
I'm pretty sure that you can't re-use a field with a calculated value in the same SELECT query, however wrapping into an additional sub-query may be an option: SELECT username, @n := @n + 1 ranking, `1st places`, `2nd places`, `3rd places`, `top5`, `top3 FROM ( SELECT *, `1st places`+`2nd places`+`3rd places` `total finishes` FROM ( SELECT username, SUM(CASE WHEN rating = 1 THEN 1 ELSE 0 END) `1st places`, SUM(CASE WHEN rating = 2 THEN 1 ELSE 0 END) `2nd places`, SUM(CASE WHEN rating = 3 THEN 1 ELSE 0 END) `3rd places`, SUM(CASE WHEN rating < 6 THEN 5 ELSE 0 END) `top5`, SUM(CASE WHEN rating < 4 THEN 5 ELSE 0 END) `top3` FROM Table1 GROUP BY username ORDER BY `1st places` DESC ) ) q, (SELECT

Categories : Mysql

How to link RSS feed created in php mysql
Step 1: You'll have to create a php file, lets say generate.php that accepts a GET param feedId: // grab feed id from $_GET if(!isset($_GET['feedId'])) { header('HTTP/1.1 400 Bad Request'); echo 'You have been missing the feed id'; die(); } $feedId = $_GET['feedId']; // now generate the *feed* depending on feed id switch ($feedId) { case 'feed1' : header('Content-Type: application/rss'); // generate feed here echo 'feed1'; break; case 'feed2' : header('Content-Type: application/rss'); // generate feed here echo 'feed1'; default : header('HTTP/1.1 404 Not found'); echo 'The document you were searching for was not found'; die(); } You can use a link like: <a href="http://server/

Categories : PHP

is it possible to convert php mysql version 5.4.42 created database to Php mysql version 5.3.21
You seem to be moving from a host that used MariaDB to one that uses MySQL (and BTW, you gave us versions of PHP and not of MySQL - they're two different things). Try changing ENGINE=Aria to ENGINE=MyISAM and remove PAGE_CHECKSUM =1 part as MyISAM does not support it.

Categories : PHP

How do I pass the image created by todataurl.js to MySQL?
.toDataURL() creates a string from your canvas image, I'm guessing this is sent to your server to save it by that javascript. Are you processing this to save your image on the server? The string sent starts with something like data:image/png;base64, followed by the actual image converted to Base 64. Update Sending the image string to your server: $.ajax({ type: "POST", url: "script.php", data: { imageString: canvas.toDataURL("image/png"); }, success: function(response){ alert("image sent"); }, error: function(xhr, status, error){ alert("there was an error sending the image" + error); }, }); You can put this in your signatureSave() function. On server side, in script.php you can simply grab the string with $_POST['imageString'], remove the identifying part from

Categories : Javascript

Why can't I login with newly created MySQL User?
I believe localhost is special and not covered by the '%'. Issue mysql> grant all privileges on *.* to mysql@'localhost' IDENTIFIED by 'myPassword' with grant option; and it should work

Categories : Mysql

"created" and "updated" columns in mysql table drupal
After toying with the syntax and different suggestions from many other stackoverflow questions/answers, I finally found the right combination of small code additions to have automatic "created" and "updated" columns in my database table. In my hook_schema() function: $schema['table'] = array( 'fields' => array( 'created' => array( 'mysql_type' => 'datetime', 'not null ' => TRUE, 'default' => format_date(time(), 'custom', 'Y-m-d 00:00:00'), ), 'updated' => array( 'mysql_type' => 'timestamp', 'not null' => TRUE, ), ), //other parts of the schema (indexes, keys...) ); In my hook_install() function: //Automatically set created datetime for current timestamp upon insert $query = db_query(' CREATE TRIGGER triggern

Categories : Mysql

Drawbacks of using manually created temporary tables in MySQL
Execution plans can't be optimal when you frequently add/use/remove tables when we would talk about databases in general. As it takes a time to generate an execution plan, the DB is unable to create one when you use described approach.

Categories : Mysql

Created datetime is not updated after insert in JPA when using trigger in MySQL
To avoid this situation you need to set the field not in database but in java. Because when you save entity it is being inserted into the cache. To get values that were updated in database you need to refresh the entity. Yes this annotation could help you to solve the problem. @PrePersist and @PreUpdate or implementing onSave(Object[] state, String[] propertyNames, Type[] types) or onUpdate with same arguments If you use second level cache and you will switch it off you can loose performance but also it can happen that you will not notice anything. Hibernate 2nd level cache is usually not giving a lot of performance improvement. Better use caching on higher level of abstraction. Such cache can give more performance improvement. But again you will not be able to use database data updates.

Categories : Java

Mysql C++ Driver - Get prepared statement query after created
Prepared statements are not worth the problems at MySQL, they are not much faster than classic SQL statements. They are not compiled as in other RDBMS. I think in this case it would be better to use a batch insert instead of a prepared statement.

Categories : C++

Openshift-django-mysql : No tables created to database via syncdb
Read this and you will understand a lot more about Django on OpenShift http://appsembler.com/blog/django-deployment-using-openshift/

Categories : Python

A table can not be created with the name Service in mixed case against innoDB of mysql 5.1.69
You can create table named Service. I checked with MySQL 5.5.32 The following works for me DROP TABLE IF EXISTS `Service`; CREATE TABLE `Service` ( idService INT, PRIMARY KEY (idService) ); DROP TABLE IF EXISTS Service; CREATE TABLE Service ( idService INT, PRIMARY KEY (idService) ) ENGINE=InnoDB; When I execute the above 2 commands I get 2 tables Service and SERVICE. May be it is a bug in mysql 5.1.69 (don't know). Try to upgrade MySQL if possible. Table details below. Name Engine Rows Data Size Index Size Total Size ----------------------------------------------------------------- SERVICE InnoDB 0 16K 0 16K Service InnoDB 0 16K 0 16K The output of SHOW VARIABLES LIKE '%version%' Variable_name

Categories : Mysql

MySQL query to aggregate the number of versions created over previous 7 days
Nailed it (yay!) thanks to @Goat CO's suggestion: SELECT p.created_at_date, SUM(status = 'draft') as draft, SUM(status = 'active') as active, SUM(status = 'archived') as archived FROM `product_versions` p JOIN ( SELECT product_id, MAX(id) AS latest_version FROM product_versions GROUP BY created_at_date, product_id ) grouped_versions ON p.product_id = grouped_versions.product_id AND p.id = grouped_versions.latest_version GROUP BY created_at_date ORDER BY created_at_date DESC Result +-----------------+-------+--------+----------+ | created_at_date | draft | active | archived | +-----------------+-------+--------+----------+ | 2013-09-07 | 2 | 1 | 1 | | 2013-09-06 | 1 | 1 | 0 | +-----------------+-------+--------+------

Categories : Mysql

CakePHP Bake Shell Error: Database connection “Mysql” is missing, or could not be created
Maybe a wrong username / password or misspelled database name. I once had a database (name) beginning with a space. It took me about 2 hours before I found out... You may want to check the database connection using plain PHP, see.

Categories : PHP



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.