[Solved] disable dropdown list if not contain any value using php

Try this script: <?php $aFilters[‘AgentName’]; $i = 0; foreach($agentsName as $ar) { echo “<option value=”$ar->id”>$ar->first_name$ar->last_name</option>”; $i++; } ?> <select <?php if ($i > 0) { echo ” disabled “} ?> name=”AgentName” id=’selAgentName’> <option value=””>Select Agent</option> </select> remove drop down script: <?php $aFilters[‘AgentName’]; $i = 0; foreach($agentsName as $ar) { $i++; if ($i>1) { echo “<select … Read more

[Solved] PHP How to generate School Year?

Change your code following way- <?php $date2=date(‘Y’, strtotime(‘+1 Years’)); for($i=date(‘Y’); $i<$date2+5;$i++){ echo ‘<option>’.$i.’-‘.($i+1).'</option>’; } ?> solved PHP How to generate School Year?

[Solved] I need a sql query to view data

SELECT cities.cityname, states.statename, countryname FROM cities JOIN states ON cities.states_id = states.id JOIN country ON states.country_id = country.id WHERE cities.id=3; Assuming 3 is the id of the city you are searching for… solved I need a sql query to view data

[Solved] error_reporting(E_ALL); Says $key undefined

No, it’s not ok – you should define the variables you use. If it’s not defined, it might be defined by, say, some other php script (assuming you have multiple in use, which is a common case). The way to clear up the error is to define variables used. 2 solved error_reporting(E_ALL); Says $key undefined

[Solved] Python looping code

You miss the lines if grade != -1: numbers.append(grade) after grade = int(grade). This adds the grade to the list numbers. Review Use PEP8 (you can use pep8online.com) to check your code For unnamed input, I prefer “Largest is %i, smallest is %i” % (max(numbers), min(numbers)) You can use sum to sum up integers in … Read more

[Solved] Finding the n-th prime number that is palindrome in base K

Solution: change palindrome to int palindrome ( int n,int base) { int isTrue = 1; int digitCount = digitCountBase(n,base); int power = intPow(base,digitCount-1); int original = n; while (n>0&& digitCount >0) { if (n%base != (original/power) % base &&digitCount!=1) { isTrue =0; return 0; } n=n/base; power = power /base; digitCount=digitCount-2; } return isTrue; } … Read more

[Solved] How i can free my application memory in c#?

1) how can I free my memory or increase the maximum used memory? Are you receiving an OutOfMemoryException and your memory isn’t filled up in your machine? This might be due to x86 compilation and you should change it to x64. 2) is there are any another way to get all my pictures to picture … Read more

[Solved] Sort a list of number by last 2 digits

You can get the last two digits using the remainder operator, then use the digits as key of sorted: a = [311, 409, 305, 104, 301, 204, 101, 306, 313, 202, 303, 410, 401, 105, 407, 408] result = sorted(a, key=lambda x: (x % 100, x)) print(result) Output [101, 301, 401, 202, 303, 104, 204, … Read more