[SOLVED] Will not return 1st recond, but returns all the res

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
DynPHP
Forum Newbie
Posts: 10
Joined: Tue Mar 04, 2003 8:25 am

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

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

show us your code.
DynPHP
Forum Newbie
Posts: 10
Joined: Tue Mar 04, 2003 8:25 am

Post 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]
DynPHP
Forum Newbie
Posts: 10
Joined: Tue Mar 04, 2003 8:25 am

Post by DynPHP »

Figgered it out, thx anyway
Post Reply