Posts

mysql - Php select from two tables not working correctly -

hello have 2 tables seo_settings | cat_id | cat_fullname | | 971 | catname 1 | | 443 | catname 2 | jcategories_to_hcategories | jcategory_id | hcategory_id | | 1 | 971 | | 2 | 443 | | 3 | 443 | and want cat_fullname category id i using $catids = array(1,2,3) foreach($catids $catid) { $sql3 = mysql_query("select a.cat_fullname seo_settings a, jcategories_to_hcategories b a.cat_id = b.hcategory_id , b.jcategory_id = $catid "); $data3 = mysql_fetch_array($sql3); } but $data3 return booleanfalse important there rows , connected correctly assume there problem in sql probably. try this $catids = array(1,2,3); $query = " select a.cat_fullname seo_settings left join jcategories_to_hcategories b on jcategories_to_hcategories b b.jcategory_id in (".implode(",", $catids).") "; $sql3 = mysql_query($query) or die(mysql_error()); while($data3 = m...

binding - How to bind a form to an SQL statement in microsoft access -

**edit hello tryng include sql statement in vba can sort through data , filter. have found way include sql in vba error says "the runsql action requires sql statement" sql statement within strsql variable. private sub buttonnot_click() dim strsql string strsql = "select table1.[firstnam], table1.[lastnam]" & _ "from table1 " & _ "where ((([firstnam]) <> 'jamie') , (([lastnam]) <> 'cartman'));" docmd.runsql strsql me.filter = "" me.filter = "firstnam<>'jamie' , lastnam<>'cartman'" end sub me.recordsource = {sql string} make sure turn filter on after appending query string.

count - Select Last of each ID in Excel -

i have table in excel multiple map units, , value corresponding each map unit. map units listed multiple times, , want last value each map unit selected. for example: mapunit = 1 ; value = 2 mapunit = 1 ; value = 4 mapunit = 1 ; value = 1 map unit =2 ; value = 3 mapunit=2 ; value = 4 mapunit = 3; value = 2 mapunit = 4; value =1 mapunit = 4; value = 5 and want output like: mapunit =1 ; value = 1 mapunit = 2; value = 4 mapunit =3 ; value = 2 mapunit =4 ; value = 5 is there formula in excel or sql query this? thank you! ok, think should work. assumptions cells reference above in a1:b9 (with column headers in row 1) , i'm putting unique mapunit numbers in column e , formulas going column f . =index(offset($b$1,match(e2,$a$2:$a$9,0),0,countif($a$2:$a$9,e2),1),countif($a$2:$a$9,e2)) please let me know if need clarification. edit: in case list of unique mapunit values longer, can make list copying original column , doing remove dupl...

c# - Why can't I access methods specific to my child class? -

in c#, have parent class public member. want derive parent class, derive class of public member, create , access new methods, follows... public class animal { } public class sheep : animal { public void makealamb() { } } public class farm { public animal myanimal; } public class sheepfarm : farm { public void sheepfarm() { this.myanimal = new sheep(); this.myanimal.makealamb(); } } this code doesn't compile. "animal not contain definition makealamb()". want essence of polymorphism, no? missing? i'm looking forward finding out. thanks in advance! if i'm guessing correctly you're intending do, consider using generics: public class farm<tanimal> tanimal : animal { public tanimal myanimal; } public class sheepfarm : farm<sheep> { public void sheepfarm() { this.myanimal = new sheep(); this.myanimal.makealamb(); } ...

logging - Log to file and console python -

i'm using python's logging module log debug strings file give me log use script attached don't give me output screen how can show print in screen , print log formatt ? help? class streamtologger(object): """ fake file-like stream object redirects writes logger instance. """ def __init__(self, logger, log_level=logging.info): self.logger = logger self.log_level = log_level self.linebuf = '' def write(self, buf): line in buf.rstrip().splitlines(): self.logger.log(self.log_level, line.rstrip()) logging.basicconfig( level=logging.debug, format='%(asctime)s:%(levelname)s:%(name)s:%(message)s', filename="out.log", filemode='a' ) stdout_logger = logging.getlogger('stdout') sl = streamtologger(stdout_logger, logging.info) sys.stdout = sl #stderr_logger = logging.getlogger('stderr') #sl = streamtologger(stderr_logger, logging.error) ...

Cordova showing shows default splash screen in iOS? -

i working on small app ios, replace images inside platforms/ios/app/resources/splash own images, still showing default image, ideas why doing this? here option can use command-option-shift-k clean out build folder. quit xcode , using terminal clean ~/library/developer/xcode/deriveddata manually. remove contents because there's bug xcode run old version of project that's in there somewhere. go terminal open app, run, cordova build ios, cordova prepare ios

python - nosetests/unittest still shows error when test passes? -

i have unit test tests if api point unaccessible if not authenticated this: def test_endpoint_get_unauth(self): r = self.get('/api/endpoint/1') self.assertstatuscode(r, 401) the test passes, nosetests/unittest still shows me error exception raised saying "not authorized." there anyway stop this? full log: error in views [/myenv/lib/python2.7/site-packages/flask_restless/views.py:115]: not authorized -------------------------------------------------------------------------------- traceback (most recent call last): file "/myapp/myenv/lib/python2.7/site-packages/flask_restless/views.py", line 113, in decorator return func(*args, **kw) file "/myapp/myenv/lib/python2.7/site-packages/flask/views.py", line 84, in view return self.dispatch_request(*args, **kwargs) file "/myapp/myenv/lib/python2.7/site-packages/flask/views.py", line 149, in dispatch_request return meth(*args, **kwargs) file "/myapp/myen...