How do I use "mysql source" command with a mysql variable?
I need to execute from mysql shell an SQL file based on a condition like mysql> source @var where @var contains the filename ...
I need to execute from mysql shell an SQL file based on a condition like mysql> source @var where @var contains the filename ...
It appears that using the LIKE in a condition with wildcards and a variable inside of dynamic sql doesn't work, although it doesn't give an error. Here's an example. The column called code has values like A0B01C02,A0B02C2D05,A0B02C2D05, etc and I am trying to match on rows containing a subset like 'B1'. When I do this it works and ret...
I know it's because of n, but n is supposed to be any variable, and left as n, this is what I have: def average(n): if n >= 0: avg = sum((range(1:int(n)))/float(len(range(1:int(n))))) print avg how do I fix it? ...
I have this version: Microsoft Visual C# 2008 Express Edition Using this function: var X = new WebClient(); Var isn't recognized by my IDE. Thanks. ...
I'm trying to create a global Robot variable in a java class without throwing AWTException. The only way that I can come up with it is by throwing the exception. The reason I need it to be global is because I need to use the same Robot variable in other methods in the class. public class Robo{ Robot r; public Robo() t...
Hi, Is there a way to set a global Javascript function within HTML. I can only pass it as a function like PostComment(this.content) So i can only access it inside the PostComment function. Is there a way to access it in another function? ...
Hi, I've been using PHP for about 4 years, however I've come across a problem that requires something with slightly (:P) better performance and so I've chosen C++. The program I'm writing is a Linux daemon that will scan a MySql database for URL's to load, load them using cURL, search for a specified string, and then update the databas...
I would like to do something like a simple and quick general console debugger. This small lib should be embedded to the main program. So I would like to do stuff like this while running the program in console mode: "input: print i" "output: 15.53" "input: set color 255" "input: print color" "output: 255" And both "i" and "color" wo...
I know this is probably a really amateur question, but I can't figure this out and I don't know much about PHP or MySQL. So I have a really simple script that basically allows a user to submit a couple lines of text and their zipcode, then it write it to a database and returns the results on the site. It's a shoutbox essentially. My c...
How can I update a variable outside of a function? For example I have this: var max_index = 0; //loop through the z-index's $(".widget_container").each(function(){ if($(this).attr("z-index") > max_index){ max_index = $(this).attr("z-index") + 1; } }); alert(max_index); The only problem with this is that max_index is ...
How can i array a string, in the format that $_POST does... kind of, well i have this kind of format coming in: 101=1&2020=2&303=3 (Incase your wondering, its the result of jQuery Sortable Serialize... I want to run an SQL statement to update a field with the RIGHT side of the = sign, where its the left side of the equal sign? I know ...
This is very dumb - but I've seen all the tutorials and guides - and my version (iReport 3.6.0) of iReport does not seem to match what I'm seeing. I need to create a new variable and use the add/modify variable dialog to format my variable - and to enter the conditions for it (Variable Expression). I've spent the better part of a day t...
This is my code. As you see in the run method, I assign values to tStart, tEnd, tAround and wTime. But when the Thread ends, they still have the default values of -1. I try printing out their values while the run() is running, and I have the correct values. But they are not 'writing' those values back to the variables when the thread end...
My web service program is supposed to generate a random code and return it to the client program. Right now it returns "" as the code instead of the randomly generated code. What is wrong with my variable scopes? Thanks. public class Service1 : System.Web.Services.WebService { private string code = ""; [WebMethod] public vo...
I'm trying to store a url such as: http://localhost/pro%5Fprint/index.php#page=home in a variable, but I can't find a function that does that. I found plenty of solutions to store the index.php, but it doesn't include the hashmark and what follows it. Is there a PHP solution for this? I did see that I can get the full url including ha...
Hi all, I think this question is really about my understanding of Garbage collection and variable references. But I will go ahead and throw out some code for you to look at. // Please note do not use this code for async sockets, just to highlight my question // SocketTransport // This is a simple wrapper class that is used as the 'st...
Is there a way to refer to a Javascript variable with a string that contains its name? example: var myText = 'hello world!'; var someString = 'myText'; //how to output myText value using someString? ...
Is there anyway to directly access the data returned in an array without a temporary variable? Currently, my code is as follows: function getData($id) { // mysql query return mysql_fetch_array($result); } $data = getData($id); echo $data['name']; Is there a direct way to get the returned data without the temporary variable? ...
Lets say I have a c program where I use only stack variables, no dynamic variables (malloc, ...) Is it possible to calculate how much memory my program will take during run time? ...
Hi, i have a tricky problem and seems like i'm stuck. I have an idea how to proceed but no idea how to do it in practice. What i want to do is convert a string inside .txt file to another format (using regex and variables?). The main problem is when i need to convert those lines marked with //comments. NOTE: "...villainx calls $x" is c...