Jump to content

lalnfl

Members
  • Posts

    136
  • Joined

  • Last visited

    Never

Posts posted by lalnfl

  1. Javascript Code:

     

    $(document).ready(function(){
    
    // selecting worker
    
    if (!document.getElementById("worker_id").value){
    
    	document.getElementById("worker_content").innerHTML="<div class='inner_right'>Select a worker to view.</div>";
    
    }
    
    
    $("#worker_id").change(function(){
    
    	if (!document.getElementById("worker_id").value){
    
    		document.getElementById("worker_content").innerHTML="<div class='inner_right'>Select a worker to view.</div>";
    
    	}
    
    	else {
    
    		var worker_id = $("#worker_id").val();
    
    		$.post("get_worker.php", {worker_id : worker_id}, function(data){
    
    			$("#worker_content").html(data);
    
    		});
    
    	}
    
    });
    
    // mark down / mark up
    
    $("#mark_up").click(function(){
    
    	var wage = $("#wage").val();
    
    	$("#wage_display").html(wage);
    
    });
    
    });

     

    Ajax Callback HTML part:

     

    <input type='hidden' name='contract_wage' id='wage' value='$wage' />
    
    		<span id='wage_display'>$$wage</span> <input class='form' type='button' name='mark_up' id='mark_up' value='Mark Up' />

     

    What is causing it to not function?

  2. You could have saved a lot of time if you had actually checked what we suggested you check, rather than taking the short cut and looking at one table of the 3.

     

    What do you mean? Everyone was set at INT, except for one of them, that I accidentally skipped.

     

    Exactly right.  requinix pointed out that the data types were a concern.  We have know way of knowing what the data types were, but we assumed that you checked all of them, not one of three.  In the future don't cut corners.  That is the lesson that hopefully you will learn.  Consistency is an important aspect of successful development practices.  It doesn't matter to requinix or myself.  Neither of us would have made the mistake you made.

     

    Well excuse me, didn't know you had to be perfect. lol

  3. You could have saved a lot of time if you had actually checked what we suggested you check, rather than taking the short cut and looking at one table of the 3.

     

    What do you mean? Everyone was set at INT, except for one of them, that I accidentally skipped.

  4. After posting a re-looking at the code and then redoing it in the phpmyadmin sql query thing, it doesn't display correctly. And the reason is if I declare more than 2 UNION statements, it messes up the results.

     

    Do you know why it does that?

  5. So I go back to my original response.  The implication is that there is something you are doing wrong in the code that displays the results.

     

    Could it be because I am using parenthesis around each SELECT part (SELECT id, card_id, ordered FROM Match_1 WHERE card_id='$card_id') UNION (...

  6. What's wrong is you're storing numbers as strings. "11" sorts before "2" because 1<2.

     

    But the real question is why you have three Match_# tables.

     

    So I would have to make the php string a number then?

  7. So say I have a union sql statement like this:

     

    (SELECT id, card_id, ordered FROM Match_1 WHERE card_id='$card_id') UNION (SELECT id, card_id, ordered FROM Match_2 WHERE card_id='$card_id') UNION (SELECT id, card_id, ordered FROM Match_3 WHERE card_id='$card_id') ORDER BY ordered ASC

     

    ordered is an INT, but yet when I order the results its like this

     

    1

    11

    2

     

    11 should obviously be last but it isn't, what am I doing wrong?

  8. You would have to set up like a file directory called Members.

     

    When a user would sign up to your site you would create a new folder for that member in the Members directory.

     

    Then it would come into work for the application you have here. You would simply pull up the image from the Members/username/profile_pic.jpg for example. Something like that.

  9. $sql_get_worker = mysql_query("SELECT id FROM Worker WHERE mem_id='$id' AND retired='n'");

    $get_worker = mysql_fetch_assoc($sql_get_worker);

     

    foreach ($get_worker as $value){

     

    $sql_get_worker = mysql_query("SELECT * FROM Worker WHERE id='$value'");

    $get_worker = mysql_fetch_array($sql_get_worker);

     

    $worker_firstname = $get_worker['firstname'];

    $worker_lastname = $get_worker['lastname'];

     

    $worker_options .= "<option value='$value'>$worker_firstname $worker_lastname</option>";

     

    }

     

    How about this then? There are two rows that return with this id, but yet only one is returning.

  10. Lets say I have this query:

     

    $sql = mysql_query("SELECT * FROM Member ORDER BY posts DESC LIMIT 10");

    while ($get = mysql_fetch_array($sql)){

     

    $row .= $get['id'];

    $posts .= $get['posts'];

     

    echo "$row - $posts<br />";

     

    }

     

    Lets say I have two of rows, with posts fields of 84 and 803. When it displays it, it grabs the 84 row first, when I want the bigger number 803 first. Is there a way to fix this?

  11. Using ajax/jquery:

     

    this is the form:

     

    <form action="" method="post">

           

            <input type="hidden" id="mem_id" value="<?php echo $id ?>" />

           

            <textarea class="text4" name="chat_message" id="chat_message" style="width: 450px; height: 100px;"></textarea>

           

            </div>

           

            <div style="width: 120px; height: 100px; float: left;">

           

            <input type="submit" class="submit" value="Submit" />

           

          </form>

     

    this is the javascript:

     

    $(document).ready(function(){

     

    var chat_message = $("textarea#chat_message").val();

    var mem_id = $("input#mem_id").val();

     

    var data = "chat_message=" + chat_message + "&mem_id" + mem_id;

     

    $(".submit").click(function(){

     

    $.ajax({url: "chats.php", data: data,  type : "POST", dataType: "script"});

    });

     

    });

     

     

    Its not sending it to chats.php, so what am I doing wrong here?

  12. How would I keep a set time, without it changing in php? I have a ajax and a javascript interval running for 3 seconds. But everytime it intervals, the time changes in my php script. So how would I keep the time that the person came onto this page?

  13. OK, if that's what they say to do with it, I guess that's what they need . . .

    Try this . . .

    if( function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() ) {
         $_POST = array_map( 'stripslashes', $_POST );
    }
    $_POST = array_map( 'urlencode', $_POST );
    

     

    Okay I got it to work. Is my cURL stuff right, when I send it back to paypal?

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.