Jump to content

fugix

Members
  • Posts

    1,483
  • Joined

  • Last visited

Posts posted by fugix

  1. I was thinking the same as Pikachu2000.

     

    Basically, if I have $array1. And it has 5 values.

     

    I want to loop through these values in a RANDOM order but retain their order in $array1.

     

    So as Pikachu2000 stated, making a copy of the array to say $array2, shuffling it and then looping through it (not necessarily echoing anything) would work as then I can return to $array1 with everything preserved in the correct order.

     

    I just want to know if there is a simpler way..

    there are other ways to do it, but as far as simplicity is concerned, the example that Pikachu2000 provided is what you want

  2. ...you can use a localhost to do this which is free

     

    Your use of terminology will cause confusion. A "localhost" is not a webserver. Every machine has a "localhost" it is simply an internal domain name pointing the machine back to itself. When you use localhost in the URL you are simply making an http (usually) request back to the pc itself. It is no different than using the machines name or IP address. For example you can ping a cmputer back to itself using localhost even if it has no web server installed. And, you can have a webserver (which uses localhost) which is not free.

    yes sorry if my wording caused confusion...thanks for clearing that up mjd

  3. if you want to grab the value of what a user is typing in, while they are typing it in...you will most likely want to use AJAX. unless you are talking about after the input is submitted? after adding the third field...no error occur, the script simply does not work?

  4. what error(s) exactly are you receiving? also the first error that i see is in this line

    $stafflist = mysql_query("SELECT * FROM StaffList WHERE full_name != 'Adam Carter' AND full_name != 'Jakata' AND branch = '$_SESSION[branch]' ");
    

    need to add quotes in your session e.g

    $stafflist = mysql_query("SELECT * FROM StaffList WHERE full_name != 'Adam Carter' AND full_name != 'Jakata' AND branch = '$_SESSION['branch']' ");
    

     

    That line was fine the way it was. The code you offered will produce: Parsing Error: /htdocs/test.php line 105 - syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING

     

    @ OP

    Regarding the following line, I don't see where $Serviceamount['item'] would ever get a value in the code you posted.

    $Serviceamount = $Serviceamount['item'];

     

    Do you have

    error_reporting = -1

    -and-

    display_errors = On

    in your php.ini file while you're doing development?

    his original code would have caused that error due to the session in the query..i simply appended or die() on the end

     

    No the OP's code wouldn't have caused that error. You added quotes in the array index, and the error I posted was copied and pasted after running the actual code with the edit you posted.

    okay, problem was solved....moving on

  5. ahhh thank you very much right the errors i get are before the button is clicked

     

    Notice: Undefined index: id in /var/www/Newkpi.php on line 12

     

    and once the button is clicked i get

     

    Fatal error: Call to undefined function check_input() in /var/www/Newkpi.php on line 28

     

    which would explain why its not inserting

     

    now solved i got rid of that function and it worked

     

    thank you to everyone especially fugix and Pikachu2000 who helped alot with my debugging problem

    glad we could help you

  6. what error(s) exactly are you receiving? also the first error that i see is in this line

    $stafflist = mysql_query("SELECT * FROM StaffList WHERE full_name != 'Adam Carter' AND full_name != 'Jakata' AND branch = '$_SESSION[branch]' ");
    

    need to add quotes in your session e.g

    $stafflist = mysql_query("SELECT * FROM StaffList WHERE full_name != 'Adam Carter' AND full_name != 'Jakata' AND branch = '$_SESSION['branch']' ");
    

     

    That line was fine the way it was. The code you offered will produce: Parsing Error: /htdocs/test.php line 105 - syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING

     

    @ OP

    Regarding the following line, I don't see where $Serviceamount['item'] would ever get a value in the code you posted.

    $Serviceamount = $Serviceamount['item'];

     

    Do you have

    error_reporting = -1

    -and-

    display_errors = On

    in your php.ini file while you're doing development?

    his original code would have caused that error due to the session in the query..i simply appended or die() on the end

  7. to check if it is a mysql error you can kill the script upon receiving an error and print the error e.g

    $stafflist = mysql_query("SELECT * FROM StaffList WHERE full_name != 'Adam Carter' AND full_name != 'Jakata' AND branch = '$_SESSION[branch]' ") or die(mysql_error());
    

    try to debug your queries and let us know your results

     

  8. what error(s) exactly are you receiving? also the first error that i see is in this line

    $stafflist = mysql_query("SELECT * FROM StaffList WHERE full_name != 'Adam Carter' AND full_name != 'Jakata' AND branch = '$_SESSION[branch]' ");
    

    need to add quotes in your session e.g

    $stafflist = mysql_query("SELECT * FROM StaffList WHERE full_name != 'Adam Carter' AND full_name != 'Jakata' AND branch = '$_SESSION['branch']' ");
    

  9. said one phrase in spanish and i get hounded..voca is a word...its puerto rican slang...im not being an "idiot troll"..is offensive though

    Slang aren't formal words.  You did not get hounded, I asked you politely.

    if i was having an entire conversation in spanish i would understand why you would intercede..however i said two words to another member that was not yourself..not sure why you felt the need to write what you did but i'll drop it because its not a big deal.sorry for writing in spanish, will never happen again

×
×
  • 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.