[thelist] PHP Newbie Stuck....

Martin McCarthy roland at ninehells.org
Fri Jun 1 13:42:52 CDT 2001


Think I see the problem here.
Change:
$row2["FIELD"] = mysql_fetch_array($result2);
To:
$row2 = mysql_fetch_array($result2);

Unless you want to call the array as $row2["Field"][0],[1],[2], etc..

Hope this helps.
-- 
Martin McCarthy

"Do not go gentle into that good night. Rage, rage against the dying of the
light." - Dylan Thomas, Do Not Go Gentle Into That Good Night

> From: <sales at iibiz.com>
> Reply-To: thelist at lists.evolt.org
> Date: Fri, 1 Jun 2001 10:49:41 -0500
> To: <thelist at lists.evolt.org>
> Subject: [thelist] PHP Newbie Stuck....
> 
> Hi all!
> 
> Lets see, got my database (CLIENTS) set up, made an input form that appears
> to be working, but I'm having trouble with my "output" form.
> 
> I'm getting an error stating:
> 
> "Warning: Supplied argument is not a valid MySQL result resource at line
> 36."
> 
> My code from line 36 on is posted below.
> 
> "cname" is identified further up on the page........any body see what my
> problem could be?  (Besides the fact that I'm a moron?!?)(The core of this
> code was copied from a book I'm using, but I inserted MY tables and
> variables......)
> 
> while ($row = mysql_fetch_array($result)) {
> $cname = $row["cname"];
> $sql2 = "select * from CLIENTS where company_name = $cname";
> $result2 = mysql_query($sql2);
> $row2["FIELD"] = mysql_fetch_array($result2);
> print("<tr><td bgcolor=\"#003399\"><b>");
> printf("<font color=\"white\">%s</font></b></td></tr>\n",
> $row["company_name"]);
> printf("<td>By: %s\n",
> $row["name"]);
> printf("<br>Posted: %s<hr>\n",
> $row["type"]);
> printf("%s</td></tr>\n",
> $row["body"]);
> }
> 
> Thanks,
> Sandy
> 
> 
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt ! 





More information about the thelist mailing list