Jump to content

Mysql selecting multiple columns


Nexus10

Recommended Posts

$result = mysql_query("SELECT * FROM Users WHERE user_name = '$user_name'");
$result = mysql_fetch_row($result);

$email = $result['email'];
$userMoney = $result['money'];
$userPoints = $result['points'];

 

Hi, how can I get the above code to work where I can use $email = $result['email']; etc by subbing in the column name in between the square brackets? Currently $email and the other two are not receiving the values as something is wrong with my query I think.

Link to comment
https://forums.phpfreaks.com/topic/206594-mysql-selecting-multiple-columns/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.