Jump to content

Reignfire

New Members
  • Posts

    7
  • Joined

  • Last visited

Reignfire's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, This is the output from a var_dump($array); command: array (size=381) 0 => array (size=2) 'Name' => string 'apple' (length=6) 'Number' => float 0.368844763 1 => array (size=2) 'Name' => string 'Blueberry' (length= 'Number' => float 5.59E-6 2 => array (size=2) 'Name' => string 'Cinnamon' (length=5) 'Number' => float -0.0006947 3 => array (size=2) 'Name' => string 'Date' (length=10) 'Number' => float 0.001584453 ... ... ... I want to sort this array from the highest 'Number' float value to the smallest. I tried sorting it with rsort($array,SORT_NUMERIC); but that doesn't give the correct output. What kind of 'sort' should i use to do this?
  2. The file i got wasn't the final version so i thought that maybe it would be easier to load the data into an array instead of importing it into the database and having to empty and refill the database everytime i got a new file. But the performance was indeed more important so i parsed the file into the database. Thanks for both replies!
  3. Hi, I have a csv-file with data like this: I have a mysql database with all the names of the ingredients and a webpage with a searchbox so for example if i search for apple select it and then i search and select blueberry i want to get the corresponding data for apple and blueberry ( -4 in the example ). I know i can read the csv-file with 'fgetcsv' but i'm not sure how to import it into an array so it's easy to use so i can search for ingredients. Does anybody have an idea how to do this in php?
  4. Yes indeed, it was a modsecurity problem. It's working again. Thanks.
  5. oh wrong section sorry, how can i move this to phpcoding help?
  6. Hi, I have a phpform where people can upload papers but they also need to fill in a little textbox with information about the paper. Most people copy some text from the word file straight into the textbox but if there are some quotes in it and you press submit you always get a Bad Request error page. The thing is if you go to the textbox and you replace the copied quotes with quotes you type yourself it works. I know there are some problems with these "smart quotes" but i put some phpcode to replace the smart quotes with normal quotes: $paperinfo = str_replace( array("\xe2\x80\x98", "\xe2\x80\x99", "\xe2\x80\x9c", "\xe2\x80\x9d", "\xe2\x80\x93", "\xe2\x80\x94", "\xe2\x80\xa6"), array("'", "'", '"', '"', '-', '--', '...'), $paperabstract); $paperinfo = str_replace( array(chr(145), chr(146), chr(147), chr(148), chr(150), chr(151), chr(133)), array("'", "'", '"', '"', '-', '--', '...'), $paperabstract); but still it isn't working. Also when i use the correct quotes and press submit it first checks for empty fields but if i use the copied quotes it isn't even checking which fields are empty it goes straight to the bad request page. Hope somebody can help me with this problem.
  7. Hi, I need to find a password of a user in my database but it's encrypted. When you create a new user in the form it's like this in the script: $query = "INSERT INTO userID (ID,user_id,first_name,last_name,email,pwd) VALUES(NULL,\"$user_id\",\"$first\",\"$last\",\"$email\",ENCODE(\"$pw\",\"MD5\"))"; ENCODE(\"$pw\",\"MD5\") When i look in my database it says: «C³(8›˜´ How can i get the right password. It's my own database and my own password that i forget.
×
×
  • 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.