Tagged Questions
-1
votes
2answers
86 views
Input arrays into MySQL using PHP [closed]
I can generate arrays of varying sizes such as these.
Example 1
$theArray=Array
(
[num_1] => 149209
[num_2] => 313888
[num_3] => 570929
[num_4] => 226386
[num_5] ...
0
votes
3answers
115 views
How to sort an associative array alphabetically in php?
I am getting my array values from database. and it is just names of users.
Iam printing them as it as they are retrieved , I want to print them Alphabetical order of their names (Ascending Order). How ...
1
vote
1answer
121 views
Accessing Associative Indexes Produced by PDO FETCH_ASSOC
I fully admit must have a faulty understanding of the construction of an associative array.
The following login script will populate $userdata with an associative array consisting of $username's ...
0
votes
8answers
91 views
mysql_fetch_assoc() gives an error
here is my code for the query in php:
$query3 = mysql_query("SELECT * FROM area_of_work") or die('Invalid query:'. mysql_error());
while($query3 = mysql_fetch_assoc($query3)){
$flag = true;
...
0
votes
2answers
142 views
Generate a query that changes a single element on multiple rows PHP MySQL
I'm working on a homework assignment that involves PHP. Basically, I have a page that contains a web form that renders items pulled from a database. There's checkboxes on each row and 2 radio buttons. ...
0
votes
6answers
839 views
Get sum of php array
I am adding elements from my SQL query to an associative array and printing them as is shown below;
foreach ($db->query($sql) as $row)
{
?>
<p>
...
0
votes
3answers
137 views
How can I insert an associative array into sql?
This is my array:
[abominado] => Array
(
[0] => réprobo
[1] => réprobo
[2] => abominado
[3] => banido
[4] => condenado
[5] ...
0
votes
2answers
752 views
output an associative array, from SQL Select with PHP
I think my mind is just drawing a blank, but basically, I want to create an associative array from various sql results
The array needs to look like:
$people = array(
"+1123456789" => "Phil"
...
0
votes
2answers
648 views
In PHP5, how do I create an associative array from a database query?
I am creating a class for an application "backbone" and I need this function to query the db, and return a multidimensional to look like this:
$myArray = ("name"=>"John", "dob"=>"January 5, ...
3
votes
6answers
5k views
How to write a good PHP database insert using an associative array
In PHP, I want to insert into a database using data contained in a associative array of field/value pairs.
Example:
$_fields = ...
2
votes
1answer
12k views
How to use an Oracle Associative Array in a SQL query
ODP.Net exposes the ability to pass Associative Arrays as params into an Oracle stored procedure from C#. Its a nice feature unless you are trying to use the data contained within that associative ...