Re: data loop timeout...
| From: | Lars Torben Wilson | Date: | Wed, 11 Oct 2000 09:49:51 +0000 |
| Subject: | Re: data loop timeout... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-19552@lists.php.net to get a copy of this message | ||
Dallas Kropka writes:
> ok, i have a connection, and Im trying to do a simple loop on a table.
>
> it bogs my system and crashes IE. could someone tell me what im doing to make it do this?
>
> code:
>
>
> echo( "<div align=\"center\">
> <table width=\"75%\" border=\"1\">
> <tr>");
>
> $select = "SELECT * FROM perm";
> $query = "mysql_query($select)";
> while ($res = "mysql_fetch_object($query)")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Just a typo, I suspect--this says "while $res takes the value of the
string 'mysql_fetch_object($query' do the loop"--remove the quotes and
you should be fine.
> {
>
> $name = $res->name;
> $email = $res->email;
> $address = $res->address;
> $city = $res->city;
BTW, this whole chunk is unnecessay--just put those in the string (you
may want to use '{}' around them in case it gets more complex later)
and skip the extra assignments.
> echo ("<tr>
> <td>$name </td>
> <td>$email</td>
> <td>$address </td>
> <td>$city</td>
> </tr>"
> );
> }
> NOTE: I have been up for way too long and had much too much coffiee
> to be doing this right now, so if there is some stupid error I
> appologize.
s/coffee/beer/g and you'd have me right now. :)
Cheers,
Torben
--
+----------------------------------------------------------------+
|Torben Wilson <torben@php.net> Netmill iTech|
|http://www.coastnet.com/~torben http://www.netmill.fi|
|Ph: 1 250 383-9735 torben@netmill.fi|
+----------------------------------------------------------------+