User Profile

Collapse

Profile Sidebar

Collapse
Samishii23
Samishii23
Last Activity: Sep 22 '14, 03:45 AM
Joined: Sep 13 '09
Location: Usa, Michigan, Westland
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Samishii23
    started a topic Why can't I pass this by reference.
    in PHP

    Why can't I pass this by reference.

    So I had built a dynamic MySQLi query class to handle all of my querys, and it was reuseable. Anyways. How I do it, is using this:
    Code:
    call_user_func_array( array( $stmt, 'bind_param' ), vref($arr) );
    vref() being a function that passes all that variables through references.

    So I used the above to do something like this:
    Code:
    $arr = array( $_FORM['data1'], $_FORM['data2'], '0', '0', ( $_FORM['data3'] ) ? $_FORM['data3'] : '0' );
    call_user_func_array(
    ...
    See more | Go to post
    Last edited by Samishii23; Dec 30 '11, 11:06 PM. Reason: Clarification

  • Are you talking about making something that stays locked in one place on the page no matter how much the user scrolls the screen?

    In Chrome just using display: fixed; works. I believe at the least IE would need an JS implementation to work. But I don't know for certain.
    See more | Go to post

    Leave a comment:


  • Samishii23
    replied to how to avoid update of a js variable
    One possible way is to have the pages load through Ajax.
    For example load the initial page then have ajax call data and load a "Main" container with the page.

    jQuery uses easy ajax calls, and can even get specific chunks of an HTML page. Like loading a page with a div with the id "stuff" and it'll return only the html of that div.

    Other then that its not really possible unless like Dorm said to...
    See more | Go to post

    Leave a comment:


  • [jQuery] Can I animate a Floating element that should get moved to next line?

    I have a thought. Consider the following:
    Code:
    <script>
    $(function(){
     $("#b").click(function(){
      $("div").animate({width: "200px"},1000);
      });
     });
    </script>
    
    <div style="width:225px;">
     <button id="b">C</button>
     <div style="float:left;width:100px;">Test</div>
     <div
    ...
    See more | Go to post

  • You mean have another span float in there to create white space?
    I was just hoping to have
    Code:
    +-----------------------------------------+
    | SPAN             SPAN               SPAN|
    +-----------------------------------------+
    Without using a 'hack' of sorts. For example wishing there was something similar to a float: center; sort of idea I guess.
    Is there something Im missing? Or is it really only "Hack"able to...
    See more | Go to post

    Leave a comment:


  • How can I make this bit of HTML centered between two floats?

    I have the following basic setup:
    Code:
    <div>
     <span style="float:left;">
      <span>Items</span>
      <span>Items</span>
      <span>Items</span>
     </span>
    
     <span style="float:right;">
      <span>Items</span>
      <span>Items</span>
     </span>
    </div>
    I wanna...
    See more | Go to post

  • How to scan file from start to finish looking for Hex codes?

    Ok. Say for example, I have a file that is a proprietary img file with extra headers for the program its used in. But its a jpg file in essence.

    I know that all JPEG files start with FFD8FFE0, and end with FFD9. So how would I go about basicly scanning the file 'til I find the starting hex characters, then reading up to the ending hex, and saving all that data to display a JPEG image. Either just for display or actually saving the...
    See more | Go to post

  • After messing around with it. I got this code to work.
    Code:
    $("input[name=radoButtons1]:checked").attr("value").
    Sorry for the wasted space.
    See more | Go to post

    Leave a comment:


  • Why am I having issues getting a radio value in jQuery?

    Ok assume the following: I have most recent jQuery, and jQueryUI, the problem is occuring in code in a seperate js file within an object function.

    I have 8 radio buttons, each the same name.
    When I call the function which at the moment is just an alert...
    Code:
    function obj() {
      this.nav = function() {
        var val = $("input[name=radioButtons1]").attr("value");
        alert(val);
        }
    ...
    See more | Go to post

  • Samishii23
    started a topic Why am I getting a MySQLi Syntax error?

    Why am I getting a MySQLi Syntax error?

    Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc) VALUES (?,?)' at line 1
    Syntax:
    Code:
    INSERT INTO equip_type (name, desc) VALUES (?,?)
    Other Syntax on my program that works:
    Code:
    INSERT INTO equipment (name,purchasedate,purchaseprice,type,lastrepair,serial,usagetype,usageval,brand,dateadded,notes) VALUES (?,?,?,?,?,?,?,?,?,?,?)
    ...
    See more | Go to post

  • Why is my Form DOM type attribute returning this?

    I'm making a confirm dialog box to ask user upon form submission if this is what he wants to enter in a database. So since all my form names are straight forward about whats being entered. I have this test function.

    Code:
    function testing() {
    	var f = document.formEquipment;
    	var l = f.elements.length;
    	var txt;
    	
    	for ( i=0; i<l; i++ ) {
    		if ( f.elements[i].type != "radio" )
    ...
    See more | Go to post

  • Hmm. Thanks for the heads up!
    See more | Go to post

    Leave a comment:


  • Portability? What doesn't use those quotes? Is it something in the MySQL config?
    See more | Go to post

    Leave a comment:


  • Thanks. And my quotes work fine. Been using them for 2+ years, never had a problem.
    See more | Go to post

    Leave a comment:


  • Does MySQL support something like an "OR" statement?

    I came across something in my code today that made me wonder if theres a way to basicly incorporate two statements into one using something like a "OR" logic.

    Basicly something like this:
    Code:
    SELECT * FROM `table` WHERE `user` = "someUser" OR WHERE `email` = "something@bs.com"
    Don't bite my head off, i'm sure thats not proper MySQL syntax, just trying to get my point across.

    Thanks...
    See more | Go to post

  • Yep, extending worked! :)
    Thanks for the help!
    See more | Go to post

    Leave a comment:


  • The reason why I'm doing this, is because I have a few data classes that I'm doing to call dynamically, and I am just putting the names into my string reference. Not particular sub types within one of the classes. Or I could rewrite the same exact class 3 times over (69 lines each) or just one with 3 more lines that takes a type parameter and dynamically sets itself up with the right data. If that makes any sense...
    See more | Go to post

    Leave a comment:


  • @johny10151981: Using the variable to dynamically instance a class is what I am doing. The question is stemming from the first post.
    Code:
    class Type {
      private $Tables = array('type1','type2'); // database tables, but exact same columns
      function __construct($type,$id) {
        // content
        }
      function stuff() { ... }
      }
    
    // Shortcut class
    class FirstType {
      function __construct($id)
    ...
    See more | Go to post

    Leave a comment:


  • By types, I mean proprietary to my project. Just internal data types for my project. They all share the same database columns so I figured it was easy to group them together.

    What I was doing was this:
    Code:
    class dm { // main program class
       private $dcNames = 'dataClass1,dataClass2...';
       }
    $_dc = explode(',', $this->dbNames);
    $dc = getClass($_dc[$section]);
    Maybe not the best method but a...
    See more | Go to post

    Leave a comment:


  • First off, as a general coding practice, try to do a little amount of <?php ?> in your page as possible. This reduces performance drastically. 2nd you don't need to put () around anything you want to echo.
    Code:
    $counter = 1 ;
    echo $name[$counter];
    If your only getting the 1st character of the $name in your foreach iteration, then whatever is being returned through the $name variable is a string.

    In PHP if you...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...