H
H
HardBIT2015-08-06 15:10:22
PHP
HardBIT, 2015-08-06 15:10:22

How to retrieve information from the database?

$row = mysql_fetch_array = mysql_query("select mog from dle_users where name = '$login'");

Unable to retrieve info from database. How to do it right? Help plz!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Rinat, 2015-08-06
@HardBIT

$row = mysql_query("select mog from dle_users where name = '$login'");
$myrow = mysql_fetch_array($row );

// вывод
 echo $myrow['mog'];

or so you
$row = mysql_query("select mog from dle_users where name = '$login'",$db);

M
Max, 2015-08-06
@MaxDukov

and what is the "conclusion"? You made a query to the database, then "compared" the result with '0'.
why "compared" - "=" is an assignment. comparison is "==" or "===". ($row = '0') is always true.
next, you updated the dle_user table by increasing the value of the money field by 1 for fields where name = $login.

L
LittleFatNinja, 2015-08-06
@LittleFatNinja

ok code!
better alreadyselect morg from...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question