variables

php, MySQL and variables containing å, ä and ö escape problem

Hi. I'm having some problem with my SQL syntax/escaping variables on my LAMP server. The command I want to use is the following: $sql=mysql_query("INSERT INTO '$table' (FirstName, LastName, StartDate, TimeStroke, DueDate, Duration, Price, Retailer, Checksum) VALUES ('$_POST[firstname]','$_POST[lastname]','$_POST[startdate]','$_POST[tim...

Changing a class with a variable as the id in jQuery?

Hey all, I am not quite getting why this doesn't seem to be working. The alert pops out the correct id, but the removeClass does not seem to be firing. What am I doing wrong? function testClassSwitch(t_id) { alert("Do things to a button with this ID: " + t_id); $(t_id).removeClass("add-button"); } Thanks! ...

Problem passing integer variable into click event in javascript and jquery

This is probably something simple but it's driving me nuts. I'm making some pagination using jquery and a while loop which has a variable called "pageNum" that updates at the end of the loop and represents the page being written out. Obviously pageNum is added to at the end of each iteration. Fine. Here's the code that's giving me a ha...

Question about Java and variables by reference that are null

I was kind of baffled when I saw the following code did not work as expected. I thought Java always passed variables by references into functions. Therefore, why the function assign the variable? public static void main(String[] args) { String nullTest = null; setNotNull(nullTest); System.out.println(nullTest); } private st...

Custom Environment Variables in PHP

Is there a way to set a custom variable such as environment_name in my apache vhost file that can be read via $_ENV or ini_get("environment_name")? ...

Sending variable pointers back and forth between C++ and Lua?

I am looking for a way to transfer the variable addresses back and forth between C++ and Lua. For instance, transferring an object from C++ to Lua and do some processing, then transfer it back to C++. However, the thing is how can you execute a C++ functions or methods from Lua? Or is a workaround required? If possible, could you incl...

mysqli object how do I get the fields

Hi. I tried this: $result = $conn->query("SELECT * FROM temp_users WHERE reg_code ='$passkey'"); This works: if($result->num_rows == 1){ values from print_r($result); mysqli_result Object ( [current_field] => 0 [field_count] => 11 [lengths] => [num_rows] => 1 [type] => 0 ) but $result->username where username is a field in the d...

Weird PHP behavior if I put exclamation point into variable name

Hello All, I have weirdest problem with PHP itself, that I've ever seen. Setup: PHP 5.33, (tried PHP 5.2.14 as well) under IIS Problem: PHP deletes all session data as soon as I put exclamation point into a key in session array. Example: session1.php session_start(); $_SESSION["foo"] = 'test'; header('Location: session2.php'); s...

PHP varible from POST form coming up blank

Hey, For some reason $password (the one being sent form the form) is coming up blank. I am manually checking for this with this code: echo "<p>$username does not match $firstandlast</p>"; echo "<p>$password does not match $dbpassword</p>"; here is my code... <?php if(isset ($_POST['submit'])) { $username = $_POST['nam...

Insert variable as object in jQuery

Hey all, I have a simple variable: var spanId = 'hi'; Now, I want to generate this: $('#hi') using the variable. So I tried: $('#' + spanId) But that didn't work. Any suggestions? Thanks, Amit ...

How to undefine a variable in Scheme?

How to undefine a variable in Scheme? Is this possible? ...

An easier way to define these variables?

$access_community = 1; $access_content = 1; $access_tools = 1; $access_administrator = 0; $access_moderator = 0; Just wondering if there's an easier way to write this using an array? This seems like overkill. Thanks! ...

AS 3.0: Calling a method, which is defined in another class, from Main class gives Error 1120

I have two classes. The Main class calls a function, which is defined in a Second class. I'm getting the following error: Error 1120: Access of undefined property myFunction Basically, I am creating buttons in the Main class that will add a corresponding Child to an Object in the Second class (if you click one button, child x1 will be...

qt tr() in static variable

Hi all, I have problem concerning translations in qt. All translations in my porject work fine, but one, which is in a static variable of a class. Corresponding part of code looks as follows The header file is similar to this: typedef struct { int type; QString problematicString; } info; MyClass::QObject_Descend...

Get the value of a variable in a loop

I have a loop that when it is called, creates a div with some form elements in them. Each div is based on a variable, "i" to give unique names to the fields and divs. Is there a way I can store what the variable was at the point of creating the div? For example, div1 is created and everything in it has 1 (the variable) attached to the n...

C++ "Variable not declared in this scope" - again

I guess this is a really simple question and, probably, one that has been answered several times over. However, I really do suck at C++ and have searched to no avail for a solution. I would really appreciate the help. Basically: #ifndef ANIMAL_H #define ANIMAL_H class Animal { public: void execute(); void setName(char*); Anima...

jQuery objects don't work

When I store a jQuery object in a variable, like this: var $myObject = $("div#comments"); ...I can't use the object $myObject! This is what I'm doing to change the html of div#comments: $myObject.html(data); It does nothing. I already tried this way too, this time to select an element inside div#comments: $("div.comment", $myObje...

AS3 accessing super class variables from subclass

Hey guys, I am hoping someone can explain about subclasses accessing variables from the super class. I found that the subclass can only access variables which are set in the constructor of the super class. Is there any way around this? package Character { import flash.display.MovieClip; public class Character extends MovieClip { ...

PHP Retry Script until Success or Error

Hi there, Thank you for taking the time to read this and I will appreciate every single response no mater the quality of content. :) I'm trying to create a php script which retries another php script up to 3 times until an error message is displayed. I'm thinking perhaps this could be done using a php loop? If the code works successful...

Setting environment variable with maven 2.x

Is it possible to set environment variable with maven (OS: Linux)? I already have user-defined properties (in the pom and in profiles.xml)....my problem is, how to execute following from Maven export GGA_FRE=/path So will be possible, that every developer can set his own path for the GGA_FRE. ...