Y
Y
Yuri Zaitsev2015-01-03 15:06:48
PHP
Yuri Zaitsev, 2015-01-03 15:06:48

How to display more than one value with the same identifier from the database?

b000d9ca38bf4daf89d621f3bf5ef25f.png
with this query I output
$query="select `id_photo` from `reiting` where `id_user`=".$_SESSION['user']."";
but in the table 2 id_user and accordingly I need to display 2 id_photo but how?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Nalomenko, 2015-01-03
@yourap

It is completely unclear what the problem is (given that the request is written correctly). Or a problem in PHP-implementation? :) You can do, for example, like this:

$query="select `id_photo` from `reiting` where `id_user`={$_SESSION['user']}";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_assoc($result))
{
  echo "{$row['id_photo']}.<br/>";
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question