yandoo Posted July 9, 2009 Share Posted July 9, 2009 Hi there, I have a query that selects records in a table where the ID = to the ID of another table. The trouble is that it doesnt repeat the results, it only outputs the 1st record!?? mysql_select_db($database_connect, $connect); $query_vege = "SELECT * FROM vegetable WHERE VegeID='" . $row_growplan['VegeID'] . "'"; $vege = mysql_query($query_vege, $connect) or die(mysql_error()); while ($row_vege = mysql_fetch_assoc($vege)) { echo $row_vege["Name"]."<br />\n"; } echo"<br>"; ?> The growplan query selects records that = the same userrname as the session name e.g. mysql_select_db($database_connect, $connect); $query_growplan = sprintf("SELECT * FROM vegeschedule WHERE Username = '%s'", $colname_growplan); $query_limit_growplan = sprintf("%s LIMIT %d, %d", $query_growplan, $startRow_growplan, $maxRows_growplan); $growplan = mysql_query($query_limit_growplan, $connect) or die(mysql_error()); $row_growplan = mysql_fetch_assoc($growplan); What am i missing here? Please help Thank You Link to comment https://forums.phpfreaks.com/topic/165343-record-not-repeating/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.