knowram Posted April 25, 2007 Share Posted April 25, 2007 Say I have a table named "Names" with 2 columns Name and date. in that table there are two rows the first has Sam in the name column and 4/23/07 in the date column. the second row also has Sam in the dame column but it has 4/24/07 in the date column. When I use the query I know select * from Names where Name = 'Sam' I get the values of the first row. how do i get the info from the second row or move to the next row that has Sam in the Name column? Thanks for the help Link to comment https://forums.phpfreaks.com/topic/48550-simple-query-question/ Share on other sites More sharing options...
benjaminbeazy Posted April 25, 2007 Share Posted April 25, 2007 $sql = "SELECT * from `Names` WHERE `Name`='Sam'"; $result = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_object($result)){ echo "{$row['name']}, {$row['date']}<br/>"; } Link to comment https://forums.phpfreaks.com/topic/48550-simple-query-question/#findComment-237699 Share on other sites More sharing options...
knowram Posted April 25, 2007 Author Share Posted April 25, 2007 Thanks i know it was simple i just haven't done it yet Link to comment https://forums.phpfreaks.com/topic/48550-simple-query-question/#findComment-237710 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.