[Solved] PHP insert into not inserting any data

$sql = “INSERT INTO tasks (taskName, requestedBy, details, dateAdded) VALUES (‘$taskname’ ,’$requestedby’ ,’$details’, ‘$datenow’)”; // Removed quotes from columns, and added missing quote on datenow Please note, this technique for adding values into the database is very insecure, and is prone to SQL injection attacks. 5 solved PHP insert into not inserting any data

[Solved] what is the most efficient way to get 1 or 2 day before the first day of week number and year in php with native functions [closed]

strtotime(‘2012W01 – 2 days’) for Saturday and strtotime(‘2012W01 – 1 day’) for Sunday since the week call is always going to return you a Monday. 2 solved what is the most efficient way to get 1 or 2 day before the first day of week number and year in php with native functions [closed]

[Solved] Trying to make sense of C++ Struct

all I want to know is what the Store() and ~Store() parts do They are declaring the struct’s constructor and destructor, respectively. what the point of the public: part is in the struct To declare them as publically accessible so outside code can call them. and also what the part in f.cpp actually does Implements … Read more

[Solved] Linq and List of Lists

This is a pretty straightforward query: allDevices.Where(d => d.Options.Any(o => o.Name == “Foot Pedal” && o.Installed)); Remember that a lambda is just a function. It can call other functions, declare variables, and everything else you can do in normal code. solved Linq and List of Lists

[Solved] jQuery translate value adding by jQuery

You missed px in css translate(0, npx) is correct, jQUery css({}) function won’t add default px when css property has multiple param this would be correct, if single param $(“<selector>”).css({‘height’: wHeight}) but translate() properly takes multiple params so you will need to add unit with value $(‘.test’).css({“-moz-transform”:”translate(0,” +wHeight+ “px)” }); solved jQuery translate value adding … Read more

[Solved] How to split a string at the n’th occurrence of a specific separator in Java [closed]

You can do something like this: Pattern pat = Pattern.compile(“((?:[^\u0003]*\u0003){30}[^\u0003]*)\u0003(.*)”); Matcher matcher = pat.matcher(input); if (matcher.matches()) { String leftPart = matcher.group(1); String rightPart = matcher.group(2); } The pattern works as follows: The first capture group finds a substring with exactly 30 occurrences of the separator \u0003; the subpattern that finds a substring with no separators, … Read more

[Solved] What’s the difference between class reference and class object when the function return class object in C++?

Abc &obj11 = fun1(); This line makes the program ill-formed; the C++ specification forbids temporaries to be bound to a reference that is not const. A compliant C++ compiler would emit an error to this effect. Presumably you are using the Microsoft Visual C++ compiler, which is well-known for allowing the binding of a temporary … Read more

[Solved] Tideman CS50 C++ Sort function [closed]

This is taking the pairs by value: void swap (pair a, pair b) // a is a copy of pairs[i] and b is a copy of pairs[j] The change you make to a and b inside the function will be discarded when the function exits. a and b are local to the function only. Take … Read more

[Solved] How do I use JQuery in my Javascript?

JQuery is a JavaScript Library. It simplifies JavaScript programming. It is a lightweight. It takes a lot of common tasks that require many lines of JavaScript code to accomplish, and wraps them into methods that you can call with a single line of code. It also simplifies a lot of the complicated things from JavaScript, … Read more

[Solved] Extract two numbers from a String with the Java Matcher class

To use Matcher you start by compiling a Pattern, then you call matcher(String) and then you see if it matches. Finally, you can parse the values. Something like, String str = “views: 120 upvotes: 540”; Pattern p = Pattern.compile(“views:\\s*(\\d+)\\s+upvotes:\\s*(\\d+)”, Pattern.CASE_INSENSITIVE); Matcher m = p.matcher(str); if (m.matches()) { int views = Integer.parseInt(m.group(1)); int upvotes = Integer.parseInt(m.group(2)); … Read more

[Solved] How can I get my threaded program to print specific output

You could do this easily in two ways: Pass a ‘print token’ between the threads using two semaphores: thread 1 prints, signals semaphore A, waits on semaphore B then loops. Thread 2 waits on semaphore A, prints, signals semaphore B and loops. Write in-line, single-threaded code. 1 solved How can I get my threaded program … Read more

[Solved] How to return char* array in c/c++ function? [closed]

Unless you have a global char*[] you want to return from this function, yes, you need dynamic allocation, it is the only way you can safely return a variable created inside the function, for all variables stored in the stack will be destroyed as soon as the function finishes. char** myfun() { char **p = … Read more