Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 4 of 4 FirstFirst ... 234
Results 46 to 56 of 56
  1. #46
    Regular Coder
    Join Date
    Aug 2013
    Posts
    141
    Thanks
    22
    Thanked 0 Times in 0 Posts
    Ive tried doing it this way but with the same result.

    Code:
    <form method="POST" onSubmit="zxcAlertPopUp.Open('drop4', true);">
    Search Criteria: <input type="text" name="sCriteria" id="Scriteria"/>
    <br/>
    <br/>
    <input type="submit" name="query" value="Run Query"/>
    <?php
    if (isset($_POST['sCriteria'])) {
        $qry = query();
    	$results2 = $qry[0];
    	}
    ?>
    </form>

  2. #47
    Regular Coder
    Join Date
    Aug 2013
    Posts
    141
    Thanks
    22
    Thanked 0 Times in 0 Posts
    Duno if this will help but here is the code for the pop up:

    Code:
    <script type="text/javascript">
    /*<![CDATA[*/ 
    zxcAlertPopUp={
    
     Open:function(id,ud){
      var o=this['zxc'+id];
      o?this.open(o,ud):null;
     },
    
     init:function(o){
      var id=o.PopUpID,pop=document.getElementById(id);
      if (pop){
       var oop=this,c=o.Clip,grp=o.Group,mcls=o.Mask,ms=o.Speed,cng=o.OnChange;
       var w=pop.offsetWidth,h=pop.offsetHeight,c=c&&o.clip!='false'?c:null,c=typeof(c)=='string'&&c!='false'?c.charAt(0).toUpperCase():'C',ms=isFinite(ms*1)&&ms>0?ms*1:1000,ctr=true,cng=typeof(cng)=='function'?cng:window[cng],msk=document.createElement('DIV'),mk,m='CHVRLDUIF?';
       o.mcls=typeof(mcls)=='string';
       pop.style.position=o.mcls?'fixed':'absolute';
       pop.style.visibility='hidden';
       pop.style.top='-3000px';
       document.body.appendChild(pop);
       msk.style.position='fixed';
       msk.style.visibility='hidden';
       mk=msk.cloneNode(false);
       msk.style.left='0px';
       msk.style.top='0px';
       msk.style.width='100%';
       msk.className=mcls;
       o.msk=msk;
       mk.style.width=mk.style.height='0px';
       mk.style.bottom='0px';
       mk.style.right='0px';
       o.mk=mk;
       document.body.appendChild(msk);
       document.body.appendChild(mk);
       o.ctr=ctr;
       o.grp=grp;
       o.w=w;
       o.h=h;
       h=Math.round(h/2);
       w=Math.round(w/2);
       o.mde=Math.max(m.indexOf(c),0);
       m=o.mde!=9?o.mde:Math.floor(Math.random()*7);
       o.ra=[[0,h,w,h,w],[0,0,w,o.h,w],[0,h,o.w,h,0],[0,0,0,o.h,0],[0,0,o.w,o.h,o.w],[0,0,o.w,0,0],[0,o.h,o.w,o.h,0],[0,0,o.w,o.h,0],[0,0]];
       c=o.ra[m];
       o.pop=[pop,m!=8?'clip':'',c.concat(),m!='8'?[100,0,o.w,o.h,0]:[100,100],m!='8'?c.concat():[0,0]];
       o.ms=ms;
       o.status=false;
       o.pud=false;
       o.lkud=false;
       o.mpud=false;
       o.mlkud=false;
       o.oncng=typeof(cng)=='function'?cng:false;
       o.grp?zxcAlertPopUp[o.grp]=o:null;
       this['zxc'+id]=o;
       oop.addevt(window,'resize','pp',o);
       oop.addevt(msk,'mouseup','open',o,false);
      }
     },
    
    
     open:function(o,ud){
      var oop=this,grp=zxcAlertPopUp[o.grp];
      ud=ud===true||ud===false?ud:!o.status;
      oop.pp(o,0);
      if (ud&&o.mde==9){
       o.pop[2]=o.ra[Math.floor(Math.random()*7)].concat();
       o.pop[4]=o.pop[2].concat();
      }
      oop.animate(o,o.pop,o.pop[4].concat(),o.pop[ud?3:2],new Date(),o.ms*Math.abs((o.pop[4][0]-(ud?100:0))/100)+5,ud);
      ud?o.pop[0].style.visibility='visible':null;
      o.mcls&&ud?o.msk.style.visibility='visible':null;
      o.status=ud;
      if (ud&&o.grp){
       grp!=o?oop.open(grp,false):null;
       zxcAlertPopUp[o.grp]=o;
      }
      o.oncng?o.oncng(o,ud):null;
      return false;
     },
    
     pp:function(o,xy){
      o.msk.style.height=o.mk.offsetTop+'px';
      o.pop[0].style.left=(o.msk.offsetWidth-o.pop[0].offsetWidth)/2+'px';
      o.pop[0].style.top=(o.msk.offsetHeight-o.pop[0].offsetHeight)/2+'px';
     },
    
     animate:function(o,a,f,t,srt,mS,z){
      clearTimeout(a[7]);
      var oop=this,ms=new Date()-srt,n,z0=0;
      for (;z0<t.length;z0++){
       n=(t[z0]-f[z0])/mS*ms+f[z0];
       a[4][z0]=Math.max(Math.round(isFinite(n)?n:a[4][z0]),0);
      }
      oop.cng(a,a[4]);
      if (ms<mS){
       a[7]=setTimeout(function(){ oop.animate(o,a,f,t,srt,mS,z); },10);
      }
      else {
       z===false?a[0].style.visibility=o.msk.style.visibility='hidden':null;
       oop.cng(a,z!==false?t:[0,0,0,0,0]);
      }
     },
    
     cng:function(a,t){
      a[1]=='clip'?a[0].style.clip='rect('+t[1]+'px,'+t[2]+'px,'+t[3]+'px,'+t[4]+'px)':this.opc(a[0],t[1]);
     },
    
     opc:function(o,t){
      o.style.filter='alpha(opacity='+t+')';
      o.style.opacity=o.style.MozOpacity=o.style.WebkitOpacity=o.style.KhtmlOpacity=t/100-.001;
     },
    
     addevt:function(o,t,f,p,p1){
      var oop=this;
      o.addEventListener?o.addEventListener(t,function(e){ return oop[f](p,p1);},false):o.attachEvent?o.attachEvent('on'+t,function(e){ return oop[f](p,p1); }):null;
     }
    
    }
    
    zxcAlertPopUp.init({
     PopUpID:'drop4',   // the unique ID name of the Pop Up DIV for a single element as an alternative.                 (default = class name option)
     Clip:'C',          //(optional) the Pop Up display mode(see Note 2)                                                (default = 'C' = center)
     Mask:'mask',       //(optional) the class name of the 'mask' to obsure other page elements.                        (default = no mask)
     Speed:500          //(optional) the animation duration in milli seconds.                                           (default = 1000)
    });
    
    /*
      ** Note 2.
        The Pop Up display modes are:
        'C' = center clip,
        'H' = horizontal clip,
        'V' = vertical clip,
        'R' = right clip,
        'L' = left clip,
        'D' = down clip,
        'U' = up clip,
        'F' = fade,
        'I' = instant,
        '?' = Random Clip
    */
    
    /*]]>*/
    </script>

  3. #48
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    I'm not going to learn jquery just to determine if this is the problem.
    Remove the use of JS from your code and run it again. If it works, your problem is the JS.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  4. #49
    Regular Coder
    Join Date
    Aug 2013
    Posts
    141
    Thanks
    22
    Thanked 0 Times in 0 Posts
    I know the code for the pop up box is correct because it works when I am not submitting anything. i.e. the button type="button" with an onclick="zxcAlertPopUp.Open('drop4',true);"

  5. #50
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    And when you remove/disable it and run the php code it does what?
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  6. #51
    Regular Coder
    Join Date
    Aug 2013
    Posts
    141
    Thanks
    22
    Thanked 0 Times in 0 Posts
    It gives the following error:

    Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /homepages/18/d228326958/htdocs/suppmytek/custDetails.php on line 25

    which is here:

    $results2=mysql_fetch_array($result);
    Last edited by daniel0816; 09-13-2013 at 02:05 PM.

  7. #52
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Your query has failed. Add an or die(mysql_error()); to the mysql_query call to find out why.
    Your JS also is not posting your form. Which indicates either that the popup is not loading this script and passing the JS to it, or that the JS is loading a different script entirely.

    BTW, if the "popup" isn't an external entity or AJAX designed, you cannot load any new data into. PHP is incapable of retaining a client connection, you must make a new request for any new data.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  8. #53
    Regular Coder
    Join Date
    Aug 2013
    Posts
    141
    Thanks
    22
    Thanked 0 Times in 0 Posts
    It says that there is an error in the sql syntax.
    Here is my query:

    Code:
    $sql="	SELECT DISTINCT Customers.CUST_ID, Customers.CUST_Forename, Customers.CUST_Surname, Customers.CUST_Email,
    			Customers.CUST_Mobile, Customers.CUST_HomeNum, Customers.CUST_AddressL1, Customers.CUST_AddressL2,
    			Customers.CUST_AddressL3, Customers.CUST_Postcode, Jobs.J_RefNum, Manufacturers.MANU_ID,
    			Manufacturers.MANU_Name,
    			Jobs.J_Model, OperatingSystems.OS_ID, OperatingSystems.OS_Name, 
    			Jobs.J_ReceivedBy, Jobs.J_DateRec, Jobs.J_FaultDesc, Jobs.J_PassWinAdmin,
    			Jobs.J_DataRecYN, Jobs.J_PowerSuppYN, JobStatus.JS_Status, 
    			
    			FROM Customers, Jobs, JobStatus, OperatingSystems, Manufacturers
    			WHERE (Jobs.J_RefNum = '$criteria' AND Jobs.J_RefNum = Customers.CUST_ID)
    			AND (OperatingSystems.OS_ID = Jobs.J_RefNum) AND (Manufacturers.MANU_ID = Jobs.J_RefNum)
    		 ";

  9. #54
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Than you have an error in your SQL Syntax to fix.
    On visual inspection it doesn't appear to be lexical, so you'll need to use your error to identify which of the properties are invalid.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  10. #55
    Regular Coder
    Join Date
    Aug 2013
    Posts
    141
    Thanks
    22
    Thanked 0 Times in 0 Posts
    Here would the problem be due to the fact that I am not using all of the results collected from the query i.e. am only using $qry[0] here:

    if (isset($_POST['sCriteria'])) {
    $qry = query();
    $results2 = $qry[0];
    }

    How do I add in the other results into this, do I just set $results2= $qry[1]
    underneath $results2 = $qry[0]; and then echo the value into CUST_Forename.

  11. #56
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    What?
    No the problem is your query is failing. Your resulting $qry is irrelevant; the results of the query are false so you cannot dereference the offset 0. You can find everything you need in the array under either the 0-based increment in column order of selection or by name since you used fetch array.
    You still need to fix your query though. If the fetch claims a false instead of a resource than the query has failed but you need to take care of that since only you know your structure.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


 
Page 4 of 4 FirstFirst ... 234

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •