Reputation: 504
I wrote a little script for read data from mysql . but i've a little problem ,
this is my code :
<?php
$con=mysql_connect('localhost','user','pass');
mysql_query("set names utf8");
mysql_query("set charset utf8");
mysql_set_charset('utf8');
mysql_select_db('dbname',$con);
$query="SELECT * FROM profiles where user_id=11";
$select=mysql_query($query);
while($row=mysql_fetch_array($select)){
echo $row['value'].' '.'';
}
mysql_close($con);
?>
for now , the script read value of column user_id = 11 , I've another column " key " , how can i read data from this row if , user_id = 11 and key = Age ?
can you help me about this issue ?
Thank you
Upvotes: 0
Views: 103
Reputation: 5734
Change the echo $row['value']
. Instead of the word value, use the column name.
Upvotes: 0