RE: [PHP] DB query returning wierd results

From: Date: Thu, 08 Aug 2002 17:42:26 +0000
Subject: RE: [PHP] DB query returning wierd results
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-111688@lists.php.net to get a copy of this message
RE: [PHP] DB query returning wierd resultsThat's because it's not a predefined PHP function, it's one I've defined outside the block of code posted to the list. However, that's not where the problem is/was. Thanks... function mysql_query_check($sql) { $result = mysql_query($sql); if(mysql_errno()) { echo "MySQL ERROR: " . mysql_errno() . " " . mysql_error()."<BR>"; echo "SQL string: " . $sql . "<BR>"; } return $result; } -----Original Message----- From: Adam Plocher [mailto:aplocher@erepublic.com] Sent: Thursday, August 08, 2002 1:18 PM To: 'John S. Huggins'; Brian V Bonini Cc: PHP Lists Subject: RE: [PHP] DB query returning wierd results What's mysql_query_check()? It's not documented on php.net -----Original Message----- From: John S. Huggins [mailto:jhuggins@va.net] Sent: Thursday, August 08, 2002 9:57 AM To: Brian V Bonini Cc: PHP Lists Subject: Re: [PHP] DB query returning wierd results On Thu, 8 Aug 2002, Brian V Bonini wrote: >-Can anyone see a reason why the following would skip the first row of >the -DB? >- >-<?php >- $sql = "SELECT * FROM SlideShow"; >- $result = mysql_query_check($sql); >- $content = mysql_fetch_object($result); I think because $content contains your first row. >- $i=0; >- while($row = mysql_fetch_object($result)) { >- $img = $row->image_name; >- $size = getimagesize("thumbnails/" . $img); >- $popupSize = getimagesize("images/" . $img); >- $popupWidth = (50+($popupSize[0])); >- $popupHeight = (250+($popupSize[1])); >- if (($i % 4) == 0) echo "<tr align=\"center\">\n"; >-echo <<<ENDJS >-<td> >-<a href="#" >>-DEFANGED_Onclick="popup('./?id=$row->id','ig','width=$popupWidth,heigh >t=$popupHeight, >-toolbar=no,scrollbars=yes,resizable=yes,location=no');"> >-<img src="/ss/thumbnails/$img" $size[3] alt="click to enlarge" >/></a><br >-/>$popupSize[0] x $popupSize[1] >-</td> >-ENDJS; >- echo "\n"; >- $i++; >- if (($i % 4) == 0) echo "</tr>\n"; >- } >-?> >- >- >--- >-PHP General Mailing List (http://www.php.net/) >-To unsubscribe, visit: http://www.php.net/unsub.php >- ************************************** John Huggins VANet jhuggins@va.net http://www.va.net/ ************************************** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#111688) next »