Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
mysql-fetch-array
- Page 1
ascending mysql fetch array excluding The or A at start
Programming
Web Development
7 Years Ago
by wikit
I know how to do a
fetch
array
to create a while loop as well as the
mysql
query in ASC order. What I…
mysql Fetch array (rows as columns)
Programming
Web Development
13 Years Ago
by DILO3D
hi all, for example. this is my
mysql
query result. A | B | C --------- a1| a2| a3 b1| b2| b3 c1| c2| c3 d1| d2| d3 i want to print the result like columnwise as following. a2|b2|c2|d2 Any suggestions please....
Re: mysql Fetch array (rows as columns)
Programming
Web Development
13 Years Ago
by urtrivedi
Explain in detail. post acutally table structure and sample data (preferably in sql format) Then post expected output.
Re: mysql Fetch array (rows as columns)
Programming
Web Development
13 Years Ago
by IIM
Use this query..... [CODE]SELECT B from table_name[/CODE]
Re: ascending mysql fetch array excluding The or A at start
Programming
Web Development
7 Years Ago
by AndrisP
order by if( substr(`ord_column`, 1, 2)='A ', substr(`ord_column`, 3), if( substr(`ord_column`, 1, 4)='The ', substr(`ord_column`, 5), `ord_column` ) ) or mutch readable (result will be same) order by case when substr(`…
Re: ascending mysql fetch array excluding The or A at start
Programming
Web Development
7 Years Ago
by wikit
Not sure how to mark something as solved but it is ... thankyou AndrisP
Re: MySQL/PHP Error!
Programming
Web Development
11 Years Ago
by n21115
…://www.php.net/manual/en/function.
mysql
-
fetch
-
array
.php) or [mysql_fetch_assoc](http://php.net/manual/en/function.
mysql
-
fetch
-assoc.php), and, go through…/manual/en/control-structures.foreach.php) to navigate through the
array
. - n21115
Mysql fetch multiple rows into php array
Programming
Databases
14 Years Ago
by cjay175
… rows from the database and then separate the rows into
array
values so I can use them throughout my code. This… output for the
mysql
query is sent to php. Is it sent as a multideminsional
array
or just a
array
? Is there a…
Re: Mysql fetch multiple rows into php array
Programming
Databases
14 Years Ago
by cjay175
*bump* SOrry if Im unclear, basically all im asking is - Is there a way to call multiple rows (3 in my case) and then sort them out according to placement variable or should I be calling individual
mysql
query for each row? Thanks again
Re: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
Programming
Web Development
12 Years Ago
by broj1
[mysql_fetch_array](http://php.net/manual/en/function.
mysql
-
fetch
-
array
.php) function returns result in both associative and numeric arrays while [mysql_fetch_assoc](http://php.net/manual/en/function.
mysql
-
fetch
-assoc.php) function returns result only in an associative
array
. It is the matter of what you want when choosing among them.
Re: fetch array values from database
Programming
Web Development
14 Years Ago
by pritaeas
Show what you have so far. For the
mysql
query to work, have a look at the FIND_IN_SET() function.
Re: Supplied argument is not a valid MySQL result
Programming
Web Development
14 Years Ago
by monica singh
Hi Dear, Try to use[B] mysql_fetch_array() with MYSQL_NUM[/B] or [B]mysql_fetch_array() with MYSQL_ASSOC[/B] or [B]mysql_fetch_array() with MYSQL_BOTH[/B] As in ur code ur r fetching the records by the field name so use MYSQL_ ASSOC(). For Example you can check this link [url]http://php.net/manual/en/function.
mysql
-
fetch
-
array
.php[/url]
how to group two tables and fetch group by category
Programming
Web Development
13 Years Ago
by wetube
…> </div>[/CODE] the problem is when i
fetch
array
from news and categories table i get each category has…
Re: Help on PHP Fetch from database!!!
Programming
Web Development
13 Years Ago
by Biiim
…]so do you advice me to use assoc instead of
array
?[/QUOTE] Nah it will make no difference, i looked up… arrays. -> [url]http://www.php.net/manual/en/function.
mysql
-
fetch
-
array
.php[/url] it should save processing time using assoc though… code will be accessed via $_POST['compcode']; and do the
mysql
query on that page to get the data
Re: Mysql fetch multiple rows into php array
Programming
Databases
14 Years Ago
by smantscheff
Is this a question of speed, readability, maintainability or what? You can do it either way as long as you are happy with it. There is no standard way because your database design is flawed. Since placements for the same url are unique (you cannot have sideadmiddle more than once for the same url, or can you?) you should have fields called …
Re: Mysql fetch multiple rows into php array
Programming
Databases
14 Years Ago
by metalix
Hi, You should use mysql_fetch_assoc instead of mysql_fetc_array This only returns the results in the row: [CODE] $result = @mysql_query("SELECT url, image, placement FROM advert WHERE user='1' ORDER BY placement"); $i = 0; while($process = @mysql_fetch_assoc($result)){ $row[$i] = $process; $placement = $row[$1]['placement'];…
Re: Help with PHP fetch
Programming
Web Development
12 Years Ago
by |-|x
I think it depends on how you access the data from the mysql_result. The [mysql_fetch_array](http://www.php.net/manual/en/function.
mysql
-
fetch
-
array
.php) man page states: > Note: This function sets NULL fields to the PHP NULL value.
PHP Multiple fetch array. Problems!
Programming
Web Development
14 Years Ago
by Bennyton
… but i'm trying to call multiple values from multiple
mysql
databnases to show up in one table, but its throwing…
Re: PHP & MySql WHILE loop
Programming
Web Development
13 Years Ago
by cereal
…quot;http://php.net/manual/en/function.
mysql
-
fetch
-
array
.php"]Returns an
array
that corresponds to the fetched row …quote="http://www.php.net/manual/en/function.
mysql
-data-seek.php"]mysql_data_seek() moves the internal …the specified row number. The next call to a
MySQL
fetch
function, such as mysql_fetch_assoc(), would return that row…
Re: how to fetch array data from one table and insert into another table in php
Programming
Web Development
6 Years Ago
by Gurjit_2
…/asan/issue/view/16693 ) ) How do i combine this
array
with the
array
`$newrefs` so that i get citations for each volume… issue? On the other hand,does the problem lie with the
mysql
…
Re: how to fetch array data from one table and insert into another table in php
Programming
Web Development
6 Years Ago
by alan.davies
… return $data; } function flatten(
array
$
array
) { $return =
array
(); array_walk_recursive($
array
, function($a) use (&$return)…[]; while ($row = $sql->
fetch
(PDO::FETCH_ASSOC)) { //Careful this function…PDO creation for $con $dsn = '
mysql
:dbname=dw;host=localhost'; $user = …
Re: basic: fetch id and data in PHP MySQL
Programming
Web Development
12 Years Ago
by broj1
…them - when you
fetch
the data use [mysqli_fetch_array](http://php.net/manual/en/mysqli-result.
fetch
-
array
.php) function which fetches… each row in an associative
array
so you can address …of the older
mysql
exstension to deal with database If you use a web form to
fetch
the data, users…
Re: Data from mysql in a 3 columns table
Programming
Web Development
18 Years Ago
by GliderPilot
… gets the first row. So you have to put the
fetch
array
inside the loop so it gets each row (each seperate…=#007700] {[/COLOR] [COLOR=#007700] $pic_code = mysql_fetch_array($result); //Get our code
array
for current pic[/COLOR] [COLOR=#007700] if ($pic_num <= $rows_nb…
Re: Return Car Make from MySQL database & have the make hyperlinked.
Programming
Web Development
16 Years Ago
by vidaj
…. Then you get your result back, and you can
fetch
the values. [code=php] // Connect to the database…returned. // mysql_fetch_assoc returns an associative
array
// http://no2.php.net/manual/en/function.
mysql
-
fetch
-assoc.php while ($row = …See [url]http://no2.php.net/manual/en/ref.
mysql
.php[/url] for more information about the different mysql_…
Re: Not showing first database item (PHP & MySQL)
Programming
Web Development
12 Years Ago
by Zagga
Hi, The problem is because you are running 2
fetch
-
array
requests on the same
mysql
result (lines 23 and 29). Try resetting the…
array
pointer after the first request. Add this to line…
Re: migration issue MySql to Postgre
Programming
Web Development
11 Years Ago
by cereal
The `pg_fetch_array()` function takes 3 arguments, not 2, so change it to: while ($filesrow = pg_fetch_array($movie_file_result, NULL, PGSQL_ASSOC)) Documentation: * http://www.php.net/manual/en/function.pg-
fetch
-
array
.php Bye!
Re: Switching From MySQL to MySQL(i)
Programming
Web Development
12 Years Ago
by LastMitch
… realize the issue: http://php.net/manual/en/mysqli-result.
fetch
-
array
.php I will give you a hint: it's an…
Re: attempting to change from mysql to mysqli
Programming
Web Development
9 Years Ago
by Taywin
You are putting the `$conn` in wrong place... Please take a look at its syntax [here](http://php.net/manual/en/mysqli-result.
fetch
-
array
.php). Tldr, put the `$conn` as part of `mysqli_query` parameter, not in `fetch_array`...
Re: How do I send mysql query results back from a php search to a htm form field
Programming
Web Development
13 Years Ago
by sDJh
… row is the fetched row of the query. When using
fetch
-
array
it's kind of [CODE]<input type="text…
Re: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
Programming
Web Development
12 Years Ago
by GraficRegret
shouldn't this while(($row=mysql_fetch_assoc($resource))!==false) read in stead while(($row=mysql_fetch_array($resource))!==false) I am not posative on this, I am stil pretty new to php, however I have not seen the assoc function used before, have only ever seen the $row use the
fetch
array
1
2
3
17
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC