Re: [PHP-DB] mysql_fetch_array limit? - more details From: Paul Worthington (prw <email protected>)
Date: 07/30/02

Thanks for all your helpful suggestions. It turns out I was limiting the
array myself by setting a temporary table column definition to varchar(255).
I have been overlooking it all this time. I feel so stupid. Thanks again for
trying to help me.

Paul

"Paul Burney" <paul.lists <email protected>> wrote in message
news:B96C4F4A.8A7A%paul.lists <email protected>
> on 7/30/02 10:34 AM, Paul Worthington at prw <email protected> appended the
> following bits to my mbox:
>
> > I'm using this PHP code, very simple and straightforward, to select two
> > columns into an array and then display the results in an HTML table:
> >
............................................................................
.
> > ...................................
> > $db = mysql_connect("localhost", "user1");
> > mysql_select_db("testdb",$db);
> > $sql = "SELECT * FROM tmp ORDER BY Name";
> > $result = mysql_query($sql,$db);
> >
> > echo "<TABLE>\n";
> > echo "<TR>\n<TH>Place Name</TH>\n<TH>Description</TH>\n</TR>\n";
> > while ($myrow = mysql_fetch_array($result)) {
> > printf("<TR><TD>%s</TD><TD>%s</TD></TR>\n", $myrow[Name],
> > $myrow[txtSWDesc1]);
> > }
> > echo "</TABLE>\n";
> >
............................................................................
.
> > ................................
> > What happens is I'm only getting the first 256 characters of txtSWDesc1
> > displayed in my table. I am assuming the problem is in
>
> Are you sure that the printf() function can take more than 256 characters
of
> input? Since you are only outputting strings, printf isn't really
necessary
> so you can use the echo command instead.
>
> Also, though this probably isn't the reason, you should quote your key
> names.
>
> while ($myrow = mysql_fetch_array($result)) {
> echo '<tr><td>',$myrow['Name'],'</td>';
> echo '<td>',$myrow['txtSWDesc1'],'</td></tr>';
> }
>
> HTH.
>
> Sincerely,
>
> Paul Burney
> <http://paulburney.com/>
>
> <?php
> while ($self != "asleep") {
> $sheep_count++;
> }
> ?>
>
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php