Posts

html - How do I return the result of a database query through a php variable to another page using the include function -

i trying occupy html div of page results of database query page via php echo command. here sample code: page performing query $content = '<h3>member login</h3> <?php //step 3: perform db query $member_info = mysql_query("select * members", $db_connect); ?> <?php // step 4: use returned data while($row = mysql_fetch_array($member_info)){ echo "first name: ".$row[1]; echo "last name: ".$row[2]."<br>"; echo "user name: ".$row[3]."<br>"; echo "password : ".$row[4]."<br>"; echo <hr>; } ?> '; include 'foundation.php'; this page issuing echo command(foundation.php): <div id="content"> <?php echo $content; ?> </div><!--end content div--> the database connection established on page know not issue. believe problem syntax because...

javascript - jQuery Scroll not working. (Uncaught ReferenceError: jQuery is not defined ) -

i have installed theme on opencart 1.5.6.4 , reason scroll carousel doesn't work. have included file below. can see errors? or @ website on chrome web inspector. the error on google chrome web inspector says uncaught referenceerror: jquery not defined but not javascript don't know error be. http://ilovefancydress.com/ link js file (function(t) { "use strict"; var = t.jcarousel = {}; i.version = "0.3.0-beta.5"; var s = /^([+\-]=)?(.+)$/; i.parsetarget = function(t) { var = !1, e = "object" != typeof t ? s.exec(t) : null; return e ? (t = parseint(e[2], 10) || 0, e[1] && (i = !0, "-=" === e[1] && (t *= -1))) : "object" != typeof t && (t = parseint(t, 10) || 0), { target: t, relative: } }, i.detectcarousel = function(t) { (var i; t.size() > 0;) { if (i = t.filt...

PHP MySQL code optimize -

is there mysql function optimize code? child id getting parent id function get_parents() { $ids = array(); while($id) : $query = "select placement_id referrals user_id = $id"; $query = $this->db->query($query); $result = $query->row(); if(!isset($result->placement_id)) : break; elseif(isset($result->placement_id) && $result->placement_id == 2) : break; endif; $id = $result->placement_id; array_push($ids, $id); if($result) : continue; endif; break; endwhile; return $ids; } the code above return parent id of given user_id, stop if nothing found. found code slow , heavy load. my table relations table | id | user_id | placement_id | | 1 | 2 | null | | 2 | 3 | 2 | | 3 | 4 | 2 | | 4 | 5 | 3 | | 5 | 6 | 4 ...

java - How do I use BaseGameUtils when all of my activities already extend off of another? -

i have hit problem signing in google play in application google play services api. i using basegameutils achievements, , have found use in activity, activity must extend basegameutils, or basegameactivity. here problem is; the activities need use basegameutils extend classes required proper function. here's example: // in play.java, 1 of main activities in use public class play extends gamestate { private boolean debug = true; // want extend basegameutils class, yet need // extend gamestate retain functional operation } how go doing using basegameutils if can't extend it, , how use when, need it, extends class. p.s. have basegameutils , needed set , working. without sign in feature, useless , crashes game. have places few try/catches in code stop debugging purposes. using basegameactivity not @ required . looking @ source basegameactivity , delegates of functionality gamehelper can instantiated , used type of act...

ios - Swift: Become First Responder on UITextField Not Working? -

Image
i've created custom uiviewcontroller 1 uitextfield on storyboard. on viewdidload , set uitextfield becomefirstresponder , nothing happened (no keyboards popped up). i tried calling resignfirstresponder() , returned false. next tried find first responder through looping subviews using code on @ get current first responder without using private api . turns out none of sub views first responder. my viewcontroller in storyboard my code class bltestviewcontroller: uiviewcontroller, uitextfielddelegate { @iboutlet var tf: uitextfield override func viewdidload() { super.viewdidload() tf.delegate = self tf.becomefirstresponder() // additional setup after loading view. } } as simple gets...why isn't keyboard coming up!!! 1 thing have on auto layout, i'm not sure if affects keyboard popping up. i tested textfield calling self.tf.becomefirstresponder() indside viewdidload() function , working absolutely fine. y...

android - Where to download Google Mobile Ads SDK -

Image
i want add ads application. made account on admob, next step download & integrate google mobile ads sdk eclipse. here download link https://developers.google.com/mobile-ads-sdk/download?hl=en_us#downloadplay with no download button. comic @ all. if change tab ios or wp8 there .zip download. on android tab there isnt any. install them sdk manager. you need dependency (you can add via maven): com.google.android.gms:play-services

mysql - Laravel Eloquent Relationship instead of Join on third table not related to parent -

i have orders table , order_items table related hasmany , belongsto respectively. there products table related order_items hasmany , belongsto respectively. what goal is, create orders object includes products without using join . is possible, how relationships set make happen in eloquent? ideally, have in with cannot figure out how make work. order model: class order extends eloquent { public function orderitems() { return $this->hasmany('orderitem'); } } orderitem model: class orderitem extends eloquent { public function order() { return $this->belongsto('order'); } public function products() { return $this->belongsto('product'); } } product model: class product extends eloquent { public function orderitems() { return $this->hasmany('orderitem'); } } query: $order = order::with('user', 'orderitems', '...