[Solved] How to get rows with most recent nulls?

I’m not so familiar with Linq-To-Sql, so i’m not sure if it is supported, but try: var query = db.TableName .Where(r1 => r1.Col2 == null && r1.Col1 < db.TableName .Where(r2 => r2.Col1 != null) .Select(r2 => r2.Col1) .OrderBy(col1 => col1) .FirstOrDefault()); At least it should be the LINQ equivalent of this (working) sql-query: http://sqlfiddle.com/#!6/439be/6/0 solved … Read more

[Solved] php session function says deprecated

The session_is_registered is deprecated, just use isset to check: if(!isset($_SESSION[‘admin’])){ And for header already sent notice, you should make sure there is no output before session_start() and any head() function. Your case is most caused by the deprecated notice if your display_errors config is on. 1 solved php session function says deprecated

[Solved] Perl regex for char ‘&’ [closed]

There must be an error somewhere else in your program. This works as expected: $s1 = ‘M&M chocolates’; $s2 = ‘Tom & Jerry’; printf(“$s1\n”) if $s1 =~ m/\w\W\w\s\w+/; printf(“$s2\n”) if $s2 =~ m/\w+\s&\s\w+/; outputs M&M chocolates Tom & Jerry solved Perl regex for char ‘&’ [closed]

[Solved] How to create more form fields by using javascript and then passing values to PHP

maybe something like this: var totalFields = <?=$total_fields?>; var currentFields = 0; var addMode = document.getElementById(‘addMore’); var form = docuement.getElementsByTagName(‘form’)[0]; addMore.onclick = function() { if (currentFields >= totalFields) { return false; } var newField = document.createElement(‘input’); newField.setAttribute(‘type’, ‘file’); newField.setAttribute(‘name’, ‘file’+currentFields); form.appendChild(newField); currentFields++ } and then <? foreach ($_FILES as $file) { // i guess you … Read more

[Solved] PHP loop to echo certain div class on first round only

<?php $i=1; while ( $loop->have_posts() ) : $loop->the_post(); ?> <!– individual panel –> <div class=”panel panel-default”> <div class=”panel-heading”> <h4 class=”panel-title”> <a data-toggle=”collapse” data-parent=”#faqs” href=”#<?php the_ID(); ?>”> <?php the_title(); ?> </a> </h4> </div> <div id=”<?php the_ID(); ?>” class=”panel-collapse collapse <?php if ($i==1) { echo ‘in’; } ?>”> <div class=”panel-body”> <?php the_field(‘answer’); ?> </div> </div> </div> <!– … Read more

[Solved] if imagesNamesList==[“None” for x in range(len(listOfImages)]: [closed]

You are missing a closing parenthesis: if imagesNamesList==[“None” for x in range(len(listOfImages))]: # here–^ However, you could write this code better (cleaner and more efficiently) like so: if imagesNamesList == [“None”]*len(listOfImages): Or, if your lists are huge, you can do as @mgilson noted: if all(x == “None” for x in imagesNamesList) and len(imagesNamesList) == len(listOfImages): … Read more

[Solved] Server to server transfer using AJAX

AJAX is generally used on the client side, not usually the server side. It sends requests to a server. You probably need to provide more information about what you are trying to achieve to get a decent answer. If you are wanting to transfer data from a “client” to a server then you could send … Read more

[Solved] HTML textbox which takes multiple values by autofill like Facebook, Google+ etc [closed]

Using JQuery UI Autocomplete : Try this code Script $(function() { var availableTags = [ “ActionScript”, “AppleScript”, “Asp”, “BASIC”, “C”, “C++”, “Clojure”, “COBOL”, “ColdFusion”, “Erlang”, “Fortran”, “Groovy”, “Haskell”, “Java”, “JavaScript”, “Lisp”, “Perl”, “PHP”, “Python”, “Ruby”, “Scala”, “Scheme” ]; function split( val ) { return val.split( /,\s*/ ); } function extractLast( term ) { return split( … Read more

[Solved] Date range filter does not work [closed]

In the code you’ve provided I can see two issues: you are overwriting the data in $result in the second call to mysql_query() you are also looking for the current date (NOW()) to be between your constraints. Assuming that you’re using a DATE or DATETIME column in MySQL rather than a VARCHAR you can do … Read more

[Solved] can i use where and order by in mysql together?

yes, this is valid as google will tell you http://dev.mysql.com/doc/refman/5.0/en/select.html For your actual error, from the php docs: For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset, mysql_query() returns a resource on success, or FALSE on error. // Perform Query $result = mysql_query($query); // Check result // This shows the actual query sent to … Read more

[Solved] PHP Simple Form Validation

You have the following in your code: $name = $_POST[‘$name’]; $email = $_POST[‘$email’]; $dob = $_POST[‘$dob’]; You’re basically trying to access undefined indexes. Remove the extra $ from the key names: $name = $_POST[‘name’]; $email = $_POST[’email’]; $dob = $_POST[‘dob’]; Then, further below, you have some conditions like this: if(condition == true) { continue; } … Read more

[Solved] incorrect if statement value returned [closed]

This condition will fail when it is 0: !empty ($_POST[‘interest’]) emtpy() will be true, so !empty() will be false. All posted values are strings, so to test for a 0 value, you could use for example $_POST[‘interest’] === ‘0’. However, that would of course fail for a string like ‘0.00’ 2 solved incorrect if statement … Read more