Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/09/2021 in all areas

  1. Is authentication supposed by handled by a client certificate or by a standard username and password? That error message suggests the connection is fine and the credentials are wrong - after all, the client must be able to connect to the server if it's able to report to you information like "the credentials are wrong".
    1 point
  2. Is the server "remote"? When you did your "command line mysql" verification, did you do that on the server or from your workstation? A "decode" of the files generated by the mysql_ssl_rsa_setup: ca.pem - the "certificate authority" public key for the self-signed certs that were generated. (You will want this file on your client) client-key.pem - the "client" private key they generated. (You will want this file on your client) client-cert.pem - the "client" certificate that was generated which goes along with the client-key. These are the files you would need available to your client. Ideally you want to make copies of those files in a directory (not under the web root) of the server running your php application, with read only permissions, but still readable by the user that the php process is running as. You need to pass an actual or relative path to the files, when you make mysqli_ssl_set initialization. mysqli_ssl_set($con,"/path/to/client-key.pem","/path/to/client-cert.pem","/path/to/ca.pem",NULL, NULL);
    1 point
  3. You are new to all of this, aren't you? You are writing functions to 1 line of work. What is the point? And I don't believe that they are all even working for your. When you do the close function your don't capture the result of the close (RTFM) but you then try and return the value of the connection value that you called it with. That value is non-existent since you just closed it. You are doing a fetch of 1 row of data in another. Why? Just use a line in your current script - no need to use a function. And in your main body that calls all of these frivolous functions you make a connection and then you close it twice and then you try and do a query with a query that does not exist. I think I'll quit this topic while I still have hair left. Good luck with your growth.
    1 point
  4. If you haven't written a custom sort function before, I suggest you start with something simple until you understand how they work. EG $array = [2, 1, 4, 3, 6, 5, 8, 7]; Then write functions to sort the above array ascending order descending order even numbers first followed by the odd numbers NOTE: A custom sort function has two arguments, $a and $b. usort() will place each pair of array items into $a and $b and call your function Your function should determine if $a should sort above or below $b by returning -1 (or a value < 0) if $a should be above $b +1 (or a value > 0) if $a should be below $b 0 if they are considered equal
    1 point
  5. That would give this, (not what your example above shows) | 1 | Amet \ | 1 | Consectetur | | 1 | Ipsum | HIDDEN, A-Z | 1 | Lorem | | 1 | Sed / | | Sit \ | | Elit | SHOW, Z-A | | Dolor | | | Adipiscing / Is that what you want? If it is then this is the function... usort($raw, function ($a, $b) { $x = $b['hidden'] <=> $a['hidden']; // sort hidden to top, show to bottom (ie hidden DESC) if ($x == 0) { // do elements have same hidden value? return $a['hidden'] ? $a['label'] <=> $b['label'] : $b['label'] <=> $a['label']; // sort label ASC if hidden, label DESC if show } else return $x; }); If it isn't, adapt the function to your requirements.
    1 point
This leaderboard is set to New York/GMT-05:00
×
×
  • 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.