I need to insert data into one table and references data into another table in ZF2 using tableGateway. For example, when I am registering a user, I have to insert user data into one table and this user hobbies data(Multiple rows) into another table with the references of the inserted user id and Update data a…
LAST_INSERT_ID not working on UPDATE
if I use this SQL: UPDATE formulare SET EV_id=59, EV_status=5 WHERE EV_id=57 AND ID_uziv=12;SELECT LAST_INSERT_ID(); I will get 0 as last insert id. I’m using php mysqli_insert_id and here is said …
“ru_RU” (russian) setlocale not working on date and time
I am trying to use Russian language with setlocale: Output is : Thursday, August 29 Expected is : четверг, РђРІРіСѓСЃС‚ 29 Any help would be highly appreciated. Answer Found it! if you are using Linux hosting then try: will works fine. In case you are using windows hosting then try:…
PHP — identifying last key in foreach to eleminate last delimeter
I’ve been trying to get this to work and while I have tried many methods posted on this site on other pages, I can’t get any of them to work. I need to identify the last key so that my results don’t have a , at the end. This sounds like such and easy task but I just cant seem
Jquery – Uncaught TypeError: Cannot use ‘in’ operator to search for ‘324’ in
I’m trying to send a Get request by ajax and output json data that is returned by server in html. But, I got this error. This is my code that sends a Get request to php file by ajax. When I use $.each method, it get the error that I showed in the above. This is my PHP code that
composer does not generate autoload.php
i install composer for windows using this link http://getcomposer.org/download/ > http://getcomposer.org/Composer-Setup.exe my web server is WAMP php 5.4 with openssl enabled. i created composer.json with this code and run with this code in .php file and i got error Warning: require_once(vendor/autoload.ph…
Difference between “as $key => $value” and “as $value” in PHP foreach
I have a database call and I’m trying to figure out what the $key => $value does in a foreach loop. The reason I ask is because both these codes output the same thing, so I’m trying to understand …
Php Regex: how to match repeated patterns
given following text I need to capture columns values. I thought something about these lines: But unfortunately it captures only first column. Any suggestion? Thanks ` ====EDIT==== Just to be clear: i know that i could preg_match searching for d+ values or split the whole string in lines and run explode on th…
PHP Warning: Division by zero
I’m learning php and built an experimental form-based calculator (also using html & POST method) that returns values to a table. The calculator is functional when I enter my values and click submit, but I keep getting two “Division by zero” errors on the last line when I first run the co…
custom category tree in wordpress
Hi i want to create a tree of categories in wordpress like this :
PARENT1
CHILD 1-1
<…