tecdesign Posted April 30, 2006 Share Posted April 30, 2006 Is there anyway of getting data from a mysql statement and storing it as a variable besides using sessions. I have found that some of my sessions are not registering. I only need the data for that particular page. For example$sql = mysql_query (select * from table where user = $username);$something = mysql_????;I hope this explains what I am trying to do.Cheers Link to comment https://forums.phpfreaks.com/topic/8746-getting-data-from-mysql/ Share on other sites More sharing options...
wildteen88 Posted April 30, 2006 Share Posted April 30, 2006 The function you are looking for is mysql_fetch_array:[code]$sql = mysql_query (select * from table where user = $username);$row = mysql_fetch_array($sql);//then whenm you want to show the results do this:echo $row['user'];echo $row['pass'];//other row names here[/code] Link to comment https://forums.phpfreaks.com/topic/8746-getting-data-from-mysql/#findComment-32122 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.