Page 1 of 1

Will not return 1st recond, but returns all the rest

Posted: Wed Aug 11, 2004 12:14 pm
by DynPHP
I have a simple search that works (almost), problem is; it returns all but the 1st record from the table.

example if I have 3 people all with the same birthday, I do a search by birthday with a sort by last name ASC, what gets returned is the 2nd and 3rd records the first record does not get shown.

Any one else ever experience this?

Posted: Wed Aug 11, 2004 12:16 pm
by feyd
show us your code.

Posted: Wed Aug 11, 2004 12:28 pm
by DynPHP
feyd | Please use

Code: Select all

tags when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Code: Select all

/*office*/
				if($_POST[month] == 0 && $_POST[year] == 0 && $_POST[flight] == "flt" && $_POST[u_office_sym] != "so"):
				
				$DO = "SELECT";
				$WHAT = "*";
				$FROM = "FROM user";
				$WHERE = "WHERE office_sym = '$_POST[u_office_sym]'";
				$ORDER_BY = "ORDER BY u_name ASC";


                                                               $u_select = "$DO $WHAT $FROM $WHERE $ORDER_BY";
                                                               $u_select_result = mysql_query($u_select) or ($u_select . ': '. mysqlerrors($u_select_result));
				
				while($uid_rows = mysql_fetch_array($u_select_result)):


				$u_id = $uid_rows["u_id"];
				$u_name = $uid_rows["u_name"];
				$u_email_address = $uid_rows["u_email_address"];
				$o_sym = $uid_rows["office_sym"];
				$day = $uid_rows["cbt_date"];
				$month = $uid_rows["cbt_month"];
				$year = $uid_rows["cbt_year"];
				$rank = $uid_rows["rank"];

				print"
						<tr>
							<td width = 20% class = 'text'>
							<a href = '$_SERVER[PHP_SELF]?formID=user_management&action=search&u_id=$u_id' class = 'report' onClick = submit();>$full_name</a>
							</td>
							<td width = 15% class = 'text' align = 'center'>
							49
							</td>
							<td width = 5% class = 'text' align = 'center'>
							CES
							</td>
							<td width = 20% class = 'text' align = 'center'>
							$o_sym
							</td>
							<td width = 5% class = 'text' align = 'center'>
							$rank
							</td>
							<td width = 35% class = 'text' align = 'center'>";
							
							if($month == '0'):
							print"IA CBT Required";
							else:
							print"$month $day, $year";
							endif;
							
							print"
							</td>
						</tr>";
				
				endwhile;

feyd | Please use

Code: Select all

tags when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Wed Aug 11, 2004 12:32 pm
by DynPHP
Figgered it out, thx anyway