0
votes
1answer
21 views

Improve dynamic input fields creation depending array size php

I want to create some input fields from an array. I have an array like $info = array("one" => "one1", "two" => "two2", "three" => "three3" ); ...
-9
votes
1answer
40 views

If in Array on PHP [on hold]

I have two result from MYSQL... $table = $db->getPrefix().'content'; $query = mysql_query("SELECT catid FROM $table WHERE id = $id"); $result = mysql_fetch_assoc($query); $catId = ...
-6
votes
0answers
26 views

How can I store multiple images to create a sort of photo album? [on hold]

I'm helping a friend make a website where users will be able to create a sort of photo album with multiple images and text accompanying each page, and post them online. But we're unsure if a simple ...
2
votes
3answers
53 views

How to interpolate two arrays?

I have two arrays: A = [1, 2, 3, 4] B = ['a', 'b', 'c', 'd'] I want to merge them into tuples (A, B) in an one-dimensional array: C = [1, 'a', 2, 'b', 3, 'c', 4, 'd'] Is there some native ...
1
vote
5answers
27 views

How to prevent double records without checking every value if exists

I`m aware that if you would like to prevent double input data in you table you can check if the value exists by a simple query SELECT `id` FROM TABLE WHERE `title` == 'test' I'm also aware that PHP ...
-1
votes
1answer
55 views

How can we Interlace the Array with php? [on hold]

I am trying to build an SQL statement like this: INSERT INTO mytable(`People`, `Places`, `Ideas`) VALUES ('40', '15', null), (null, '5', '10'), ('10', null, ...
0
votes
1answer
13 views

How to get error being returned by FILTER_VALIDATE_EMAIL

I am currently working in php. My current form is supposed to generate some criteria for an email template. It has a To, CC, and BCC field. My current code for "To" works fine. I then wanted to ...
0
votes
1answer
12 views

sqlite value to php variable (drupal)

I have little SQL expirience and think this question may be so simple there is almost no support for it online. How do i pull a single value from a single record in a SQLite database and place it in ...
1
vote
1answer
23 views

Recursive menu, write all parents and childs

I need a little help with recursive dropdown menu. Here is my array: Array ( [0] => Array ( [cat_id] => 4 [cat_name] => Plátna [cat_nodia] ...
-1
votes
3answers
41 views

php issue with array key value

i'm new in php and i have problems with this piece of code i do not figure out , why 'echo' prints : x ? error 3000 3000 is a key , indeed should be printing "scanner error" ... what's wrong in my ...
0
votes
0answers
11 views

odbc_fetch_array appears to be duplicating one element

I am migrating a process to PHP to process some supplier price files. The field names that are important are pcc_id (commodity code varchar(6)) and spg_free2 (supplier code varchar(6)). These values ...
0
votes
2answers
43 views

How to use foreach when there is no array in the object?

I was using this successfully, so I thought: foreach ($trip->STOPS->STOP as $key=>$value) { Most of the time the data looks like this: ["STOPS"]=> object(stdClass)#247 (1) { ...
0
votes
1answer
20 views

array_search function doesn't check first value

I have an array which gives me correct results when I print it, for example: [0] => [email protected], [1] => 0909, [2] => [email protected], [3] => 0909 Now, when I want to check if ...
1
vote
1answer
37 views

PHP Array index addition - different levels

I have 2 arrays as follows :- $m_aggregate = array( 'weighted' => array (40000, 30000, 90000, 0), 'unweighted' => ...
1
vote
4answers
55 views

create a PHP function that works for simple arrays and nested arrays

I am trying to create a function that works on both simple arrays and nested arrays. So far, the function looks like this: function fnPrepareDataForBrowser($values) { $values = ...

1 2 3 4 5 1145
15 30 50 per page