php-general Digest 25 Mar 2011 09:05:48 -0000 Issue 7242
Topics (messages 312033 through 312035):
Re: echo?
312033 by: Tamara Temple
312034 by: Hans Ã
hlin
Hi [email protected], Kunal invites you to join Games24x7.com
312035 by: usang2me.gmail.com
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
On Mar 22, 2011, at 9:50 PM, Jim Giner wrote:
Yes - it is J and I. I tried using $i+1 in the echo originally but it
wouldn't run. That's why I created $j.
Interesting it wouldn't run.. perhaps that's a place to investigate?
And just what is wrong with the old cr/lf sequence? How would you
have done
it?
If it is being sent to a browser, which i suspect given the html
entities encoding, i would have used "<br />".
If it is being sent to a terminal or file, I would have used "\n".
What do you mean 'this alone .....'?
Merely that the construction I see shouldn't matter whether you use $j
or $i+1.
"Tamara Temple" <[email protected]> wrote in message
news:[email protected]...
On Mar 22, 2011, at 8:42 PM, Jim Giner wrote:
ok - here's the code in question.
$q = 'select * from director_records ';
$qrslt = mysql_query($q);
$rows = mysql_num_rows($qrslt);
for ($i=0; $i<$rows; $i++)
{
$j = $i+1;
Am i reading this correctly: the first variable is j (jay) the second
variable is i (eye) ?
This alone doesn't explain anything...
$row = mysql_fetch_array($qrslt);
echo $j.'-'.$row['userid'];
Since this is the only place $j is used, try subbing in $i+1 and
see what
you get.
if ($row['user_priv']<> "")
echo ' ('.$row['user_priv'].')
';
This is really rather a strange way of getting a line break.
else
echo '
';
}
The output I get is:
1-smith5
f-ginerjm (M)
g-smith8
While the alpha parts are valid, the index is only correct for
the first
one
(0) obviously.
--- End Message ---
--- Begin Message ---
2011/3/23 Jim Giner <[email protected]>:
> ok - here's the code in question.
> $q = 'select * from director_records ';
> $qrslt = mysql_query($q);
> $rows = mysql_num_rows($qrslt);
> for ($i=0; $i<$rows; $i++)
> {
> $j = $i+1;
> $row = mysql_fetch_array($qrslt);
> echo $j.'-'.$row['userid'];
> if ($row['user_priv']<> "")
try > echo ' ('.$row['user_priv'].")
\r\n"; //If you
don't put \r\n or a space at the end of the echo then the beginning on
the next line is going to be interpreted as #101/#102/#103 aso (that i
figured when you wrote that putting a space in the beginning of the
echo solved the problem.
> else
echo "
\r\n";
> }
--
**********************************************
Hans Åhlin
Tel: +46761488019
icq: 275232967
http://www.kronan-net.com/
irc://irc.freenode.net:6667 - TheCoin
**********************************************
--- End Message ---
--- Begin Message ---
| Games24x7.com | | | Hey [email protected], | | | | Try this out, & win real cash lyk i did | Your friend Kunal, invited you to join Games24x7.com. For the 1st time in India, only on Games24x7.com, you can play online rummy for cash. You can play with your friends, family and hundreds of players from across India, and win daily cash prizes. Kunal joined Games24x7.com on Thu, Mar 17, '11 and plays with the ID - usang2me. If you register now (completely fr ee) by clicking on the unique link below Kunal could be awarded a referral bonus of Rs. 500*. | | | YES, I know Kunal - Register me for free now! | | | Join now, enjoy playing rummy and help your friend win Rs. 500 in cash. | | | | Player Relations Team | www.Games24x7.com | | * This special offer is valid only if you register using the link provided in the email. Your friend gets Rs. 500 after you fulfill the terms of the offer. Register on Games24x7.com and visit promotions page to learn more. | | | | | |
|
© 2010 www.Games24x7.com | Gokul Bldg, 3 Tejpal Road, Mumbai 400 007, India
You are receiving this email from Games24x7.com as your friend Kunal, e-mail id [email protected], informed us that you have consented to receive this e-mail from us and you are 18 years of age or above. If you are below 18 yrs please unsubscribe right now and you will not receive any more emails from us.
--- End Message ---