F
F
FraudCrew2014-04-15 13:42:20
PHP
FraudCrew, 2014-04-15 13:42:20

How to display the query as an array?

Here is a request:

$q=mysql_query("SELECT t1.id as id, t1.price, t1.group_id, t1.name, t1.description, t2.parent_id, t2.name as group_name, t3.file FROM `rcvostok_product` t1	inner join `rcvostok_product_group` t2 on (t1.group_id = t2.id) inner join `rcvostok_product_image` t3 on (t1.id = t3.product_id) ORDER BY t3.product_id ASC LIMIT 0, 200");

I'm trying to output like this:
$row = mysql_fetch_array($q);
echo $row;

Displays only:
ArrayArray

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander, 2014-04-15
@alexofree

Tryprint_r($row);

1
1001001 111, 2014-04-15
@IgorO2

In a loop
, use the foreach() function

F
FraudCrew, 2014-04-15
@FraudCrew

It worked, thanks!
But how to set the encoding?
Outputs:
Name:
, 7, ????????? ??????? ???? 6?? (24??) LR6024-150GSRB
Name:
, 7, ????????? ??????? ???? 6?? (24??) LR6024-150GSRB

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question