How to prepare for mySQL too many requests?

Thanks for taking time to my problem. I am new to MySQL. My problem is I want to make many (about 1000 clients' requests) select/insert queries to a MySQL database within a second. I found there is a proper limit on it about 250-500 concurren...
more »

2017-03-18 22:03 (1) Answers

PHP CURL getting 400 error in loop

here the foreach loops returns a phone number which goes in the link but whenever I try to run this script it gives me the error 400 bad request. I have also tried using the useragent but even that does not solve the error. any help would be great. ...
more »

2017-03-18 21:03 (1) Answers

Add another data to json array with PHP

I'm trying to create a JSON array with loop, I stored languages name in database and retrieving from query, after that I need to convert it into this format $arrayName = array('lang-1' => null , 'lang-2' => null, ..... ,'lang-n' => null ); ...
more »

2017-03-18 19:03 (2) Answers

Search in array and use it to save

I've been working this week on a special project with imports. the function that i have created import a xml from diffrent sources and save this in my database. My solution on that is: - Save al the keys that i want from the XML and save it into my...
more »

2017-03-18 19:03 (1) Answers

SQLite : GROUP BY without Aggregate

I'm trying to understand a strange behaviour of GROUP BY on SQLite v2.8.17 Here is the code : <?php $selectMaxQuery = $this->_db->prepare('SELECT COUNT(*) AS c FROM (SELECT MAX(groupCode) FROM docs GROUP BY groupCode)'); $selectQuery = $th...
more »

2017-03-17 17:03 (1) Answers

Retrieve keys of an array of objects

I have an object with 2 attributes: id and name (class name: MyObject): class MyObject { public id; public name; } And I have an array "MyObjects" where each item is a MyObject instance. I am looping through this array to display all the obje...
more »

2017-03-17 14:03 (2) Answers

How to run multiple query in single query

I don't know what kind of title i need to use for this question anyone can help me to choose a title. Anyway My question is I need to run this query. SELECT key_features,about_course FROM `page_sections` WHERE page_id=15 AND country_id=241 AND...
more »

2017-03-17 13:03 (3) Answers

Laravel: orderBy a column with collections

I need to OrderBy a column with collection. I need to orderBy(updated_at, 'desc') all posts which owned by current logged user. Here is my code : $posts = auth()->user()->posts->sortByDesc('updated_at'); Here is User model : class Use...
more »

2017-03-17 11:03 (3) Answers

Exception out of memory from Android

I have a problem with restoring Images from the database to the android using a type byte [] and we pass ArrayList images to our adapter in which we use Glide, but I can recover more than 20 images of the database using service web PHP , applicatio...
more »

2017-03-17 10:03 (1) Answers

check lat/long position resides within a Polygon

i need to check if users lat and long resides in polygon. my mysql version is 5.1.73 The Query i tried are as below SET @g1 = ST_GEOMFROMTEXT('POLYGON((9.557417356841308 80.3155517578125, 7.993957436359008 79.7772216796875, 6.926426847059551 79.81...
more »

2017-03-17 08:03 (1) Answers

Output value from table in view

I've got a problem in Laravel. I have passed my whole table to my view like this from my controller: $usersTable = DB::table('users')->get(); return view('users')->with('users', $usersTable); In a foreach loop I can perfectly get each of the...
more »

2017-03-16 15:03 (4) Answers

Extract data from SOAP response in PHP

I have this XML response coming from OSvC and I want to process it to extract sfdc_record_id and print its value a0t4C000000I8YPQA0. How to print that data in PHP? <pre> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelop...
more »

2017-03-16 15:03 (1) Answers

Writing tests for controllers with forms

Ever since I started using Zend Framework 3, I had problems with testing my controllers. I'm trying to test my controllers with PhpUnit 5.7 and my controllers depend on Zend Form, which is hydrated with Doctrine's DoctrineObject. I'm trying to put th...
more »

2017-03-16 11:03 (0) Answers

Simple Page Redirect Using URL

I want my index.php to redirect to my welcome/index.html. I know there are so many ways to do it but I want to shorten it just like Facebook does. I want a url based redirection. I want to redirect index.php to welcome/index.html by using url. For ...
more »

2017-03-16 10:03 (3) Answers

CakePHP, jQuery - Add data attribute to anchor

I'm looking for a way to insert a data attribute to my table anchors in CakePHP. It automatically generates the following code, but I have no clue on how to alter this in a way where I make it a data-target attribute. The reason I want to achieve th...
more »

2017-03-16 09:03 (2) Answers

Database multiple choice and comments structure

I've read a lot of pages but didn't find what I was looking for. I am trying to figure out which is the most appropriate solution for my problem here. I currently got a multiple choice form with 23 questions and 23 comments section (650 characters ea...
more »

2017-03-15 23:03 (1) Answers

PHP Multiupload images and insert to one field

I trying to create multiupload images and enter them all into one field in the database (mysql) but the problem is because each image is entered as a separate record, and I want all the photos in one record, field. How it is: How must to be: ...
more »

2017-03-15 17:03 (0) Answers