Jump to content

Barand

Moderators
  • Content Count

    21,392
  • Joined

  • Last visited

  • Days Won

    542

Barand last won the day on February 21

Barand had the most liked content!

Community Reputation

1,630 Excellent

About Barand

  • Rank
    Sen . ( ile || sei )

Profile Information

Recent Profile Visitors

65,753 profile views
  1. @Cor4Flez Let sleeping posts lie. This one is two years old.
  2. @Hendz I recommend you use PHP's password_hash() and password_verify() functions.
  3. This should get you started (if you haven't already) ... $array = array ( 'data' => array ( '0' => array ( 'latitude' => 22.934566, 'longitude' => 79.08728, 'type' => 'county', 'distance' => 44.328, 'name' => 'Narsinghpur', 'number' => '', 'postal_code' => '', 'street' => '', 'confidence' => 0.5, 'region' => 'Madhya Pradesh', 'region_code' => 'MP', 'county' => 'Narsinghpur',
  4. 0 out of 10 for formatting. What have you tried so far? What was the outcome?
  5. You could, except that does the exact opposite of what is required in this instance.
  6. It certainly wasn't how to read replies and take advice 🙂 , so again, in case you missed it, here's the 1 line solution with no SQL required echo round($pop / (date('z')+1));
  7. Alternaltive method... mysql> SELECT * FROM users; +--------+--------------+-----------+----------+ | userId | fullname | firstname | lastname | +--------+--------------+-----------+----------+ | 1 | Peter Dowt | NULL | NULL | | 2 | Laura Norder | NULL | NULL | | 3 | Tom DiCanari | NULL | NULL | | 4 | Scott Chegg | NULL | NULL | +--------+--------------+-----------+----------+ mysql> UPDATE users -> SET firstname = SUBSTRING_INDEX(fullname, ' ', 1), -> lastname = SUBSTRING_INDEX(fullname, ' ', -1);
  8. The missing quotes around $password aren't helping either, but when you do it correctly, using a prepared statement, then that problem will disappear.
  9. You will actually need both the id and the name The label/for attributes use the id, POST variables use the name.
  10. I gave you a one line PHP solution in my first post Your code works for me. It could be a conection problem. Check for mysql errors using mysqli_report() (EG this is my mysqli connection code)... mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); $db = mysqli_connect(HOST,USERNAME,PASSWORD,$database); $db->set_charset('utf8');
  11. Show your current code that gives that result. Why do you insist on usng SQL for this?
  12. Do you charge per line of code, or are you of the school of programming that thinks "Why use one line of code when you can do it with several?" Anyway, here's a mysqli version $pop = 54321; $result = $donnees->query("SELECT DAYOFYEAR(CURDATE()) as dayno"); $row = $result->fetch_assoc(); echo round($pop / $row['dayno']); //--> 1006
  13. The main point is the query. Use DAYOFYEAR to get the number of days from start of year, it's easier and doesn't produce a zero value. (and you can use that same query just as well with MySqli) Yours will fail (div by 0) if you run it on the 1st Jan. Also note the use of SQL is overkill when you can do what you want with a simple one liner in PHP.
×
×
  • 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.