PHP date() format when inserting into datetime in MySQL

The problem is that you’re using ‘M’ and ‘D’, which are a textual representations, MySQL is expecting a numeric representation of the format 2010-02-06 19:30:13 Try: date(‘Y-m-d H:i:s’) which uses the numeric equivalents. edit: switched G to H, though it may not have impact, you probably want to use 24-hour format with leading 0s.

A non well formed numeric value encountered

Because you are passing a string as the second argument to the date function, which should be an integer. string date ( string $format [, int $timestamp = time() ] ) Try strtotime which will Parse about any English textual datetime description into a Unix timestamp (integer):

How to run a PHP function from an HTML form?

The “function” you have is server-side. Server-side code runs before and only before data is returned to your browser (typically, displayed as a page, but also could be an ajax request). The form you have is client-side. This form is rendered by your browser and is not “connected” to your server, but can submit data to the server for processing. Therefore, … Read more

Paypal IPN Verification Postback with HTTPS

hostname If OpenSSL support is installed, you may prefix the hostname with either ssl:// or tls:// to use an SSL or TLS client connection over TCP/IP to connect to the remote host. http://www.php.net/fsockopen The port would also need to change to 443. So: https:// would not work because you’re opening a socket, which is a low-level transport. HTTP is an application level protocol on … Read more

JavaScript equivalent of PHP’s in_array()

No, it doesn’t have one. For this reason most popular libraries come with one in their utility packages. Check out jQuery’s inArray and Prototype’s Array.indexOf for examples. jQuery’s implementation of it is as simple as you might expect: If you are dealing with a sane amount of array elements the above will do the trick nicely. EDIT: Whoops. I … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)