Friends, help me figure it out.
There is a database called NAME. It has 2 columns: name1 and name2 .
I need to output the value of the column name2 , provided that in this line name1 = $SuperName=$_REQUEST['name'] .$_REQUEST['name'] is transferred correctly (I try to select a string and put it in $ data).
Next is my code:
$Подключение к БД $SuperName=$_REQUEST['name']; $sql= mysql_query("SELECT * FROM NAME WHERE name1='$SuperName' ",$db); if($sql) { while($data = mysql_fetch_array($sql)) { echo $data['name2']; } } else { print mysql_error(); } The output writes an error that Name2 is not defined. Perhaps this question is unrealistically simple, but I cannot understand what is wrong. Honestly read similar questions. Dumb, I did not understand what is wrong :(
var_dump($data);die;In the inside of the while loop what does it write? - Naumov