Hi Jim,

Ahh yes of course....I have corrected this.

I am still getting the error on the first query...not sure why. And now
I am getting a whole bunch of empty lines being output to the screen.
Like there is supposed to be data in those lines, but nothing happening.
Plus I am getting repeats of the same data. Its like it is doing each
query three times or something.

Don't know why it is doing that.

- Shannon

> -----Original Message-----
> From: Jim Lucas [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, 21 December 2001 03:52 AM
> To: Shannon Doyle; [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] Mysql result resource error
> 
> 
> which one was giving you the problem? the first or second 
> mysql try.  if it
> was the second, try wrapping the $cattyname with single 
> quotes  like this
> Minor_Category = '$cattyname'.  if the $cattyname var has anything but
> numbers, the statement won't work.
> 
> Jim
> ----- Original Message -----
> From: "Shannon Doyle" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, December 19, 2001 4:19 PM
> Subject: [PHP-DB] Mysql result resource error
> 
> 
> > Hi People,
> >
> > I am getting a Not a valid Mysql result resource error with the
> > following code, can someone take a look at this for me and 
> see if there
> > is anything that stands out
> >
> > Thanks,
> >
> > Shannon
> >
> > <?
> > $cattyname = "";
> > $sql = "select Minor_Category main where Page = 'wines' order by
> > Minor_Category";
> > $dbh = @mysql_connect($dbhost,$dbuser,$dbpass);
> > $results2 = mysql_db_query($db,$sql,$dbh);
> >   for($j = 0; $j < mysql_num_rows($results2); $j++) {
> >   $array[$j] = mysql_fetch_array($results2);
> > }
> > mysql_close($dbh);
> > for ($h = 0; $h < count($array); $h++)  {
> >
> > if ($array[$h]["Minor_Category"] != $cattyname) {
> >   $cattyname = $array[$h]["Minor_Category"];
> >   echo "<tr><td colspan='4'><a
> > name='".$cattyname."'></a><b>".$cattyname."</b></td></td></tr>";
> >
> >
> > $catname = "";
> > $sql = "select Category,Code,Description,Pack,Unit,Price 
> from main where
> > Page = 'wines' && Minor_Category = $cattyname order by Category";
> > $dbh = @mysql_connect($dbhost,$dbuser,$dbpass);
> > $results = mysql_db_query($db,$sql,$dbh);
> >   for($i = 0; $i < mysql_num_rows($results); $i++) {
> >   $array[$i] = mysql_fetch_array($results);
> > }
> > mysql_close($dbh);
> >
> > for ($i = 0; $i < count($array); $i++)  {
> >
> > if ($array[$i]["Category"] != $catname) {
> >   $catname = $array[$i]["Category"];
> >   echo "<tr><td colspan='4'><a
> > name='".$catname."'></a><b>".$catname."</b></td><td
> > align='center'><p><b>Carton Size</b></p></td><td
> > align='center'><p><b>Unit</b></p></td><td
> > align='right'><p><b>Price</b></p></td><td><a href='#top'><img
> > src='images/arrow.gif' border='0'></a></td></tr>";
> > }
> >
> >   echo "<tr><td></td><td><p><a
> > href=javascript:order_now(&quot;".$array[$i]["Code"]."&quot;)><img
> > src='images/order.gif' border='0'></a></td><td></td><td
> > align='left'><p>".$array[$i]["Description"]."</p></td><td
> > align='center'><p>".$array[$i]["Pack"]."</p></td><td
> > align='center'><p>".$array[$i]["Unit"]."</p></td><td
> > align='right'><p>$".$array[$i]["Price"]."</p></td></tr>\n";
> > }
> > }
> > }
> > ?>
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> >
> >
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> 
> 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to