Missing first record from query in IE, firefox is fin

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
benxmy
Forum Newbie
Posts: 3
Joined: Fri Sep 15, 2006 10:43 am

Missing first record from query in IE, firefox is fin

Post by benxmy »

JayBird | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I've run into this a couple of times and haven't been able to track down the issue.  I have a query that in firefox returns all the results, but in IE fails to retun the first result, but returns all others.

Code: Select all

$prog_sql = "SELECT c.*
		FROM catalog c
		WHERE c.catalog_index = '77'";
$prog_res = mysql_query($prog_sql) or die(mysql_error());
?>

<table style='background-color: #ffffff; color: #000000' name='main_table' id='main_table' border='1px' cellpadding='3px' width='150px'>
<tr>
<form name=self_enroll_1 id=self_enroll_1 method=POST action='vweek07_2.php'>
<td align='left'>Catalog Item</td></tr>

<tr><td><select size='7' id='catalog_index' name='catalog_index'>
<?

while($row = mysql_fetch_array($prog_res))
{
	$catalog_index=$row[catalog_index];
	$item = $row[item];
	print("<option value='$catalog_index'>$item</OPTION>");
}
?>
</select></td></tr>
<tr><td><input type=submit value='Next'></form></td></tr>
</table>
Anyone have any ideas why this might be happening? I thought maybe another set of eyes could catch something I'm missing... Thanks!


JayBird | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
GM
Forum Contributor
Posts: 365
Joined: Wed Apr 26, 2006 4:19 am
Location: Italy

Post by GM »

Best thing to do in cases like this is check the source of your page. PHP and MySQL work independently of the browser they are writing to, so it's definitely not a problem with your query or program logic.

It might be that you've got some badly formed HTML that IE won't display for some reason, but Firefox does.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Code: Select all

<?php
$prog_sql = "SELECT c.*
                FROM catalog c
                WHERE c.catalog_index = '77'";
$prog_res = mysql_query($prog_sql) or die(mysql_error());
?>
<form name=self_enroll_1 id=self_enroll_1 method=POST action='vweek07_2.php'>
	<table style='background-color: #ffffff; color: #000000' name='main_table' id='main_table' border='1px' cellpadding='3px' width='150px'>
		<tr>
			<td align='left'>Catalog Item</td>
		</tr>
		<tr>
			<td><select size='7' id='catalog_index' name='catalog_index'>
			<?
			
			while($row = mysql_fetch_array($prog_res))
			{
					$catalog_index=$row['catalog_index'];
					$item = $row['item'];
					print("<option value='$catalog_index'>$item</OPTION>");
			}
			?>
			</select></td>
		</tr>
		<tr>
			<td><input type=submit value='Next'></td>
		</tr>
	</table>
</form>
Post Reply