php-windows Digest 4 Oct 2002 12:38:23 -0000 Issue 1371

Topics (messages 16150 through 16159):

Alternate table rows
        16150 by: Davy Obdam
        16151 by: Flint Doungchak
        16152 by: Dash McElroy
        16153 by: Rich Gray
        16158 by: Nikolai Jeliazkov

Looking for feedback
        16154 by: Erich Kolb
        16156 by: Erich Kolb

Re: Need SQL Help for PHP_WIN and ODBC/Access
        16155 by: Uttam

Re: Using mail() with w2k/IIS5 with SMTP feature
        16157 by: Ernani Joppert Pontes Martins

Error
        16159 by: Ivo Stoykov

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 ---
Hi people,..

I have a table wich is created with php and ofcourse the data comes from
a database. To make it more readable i would like to alternate the color
of each table row. For instance 1st row:#efefef 2nd row:#d3d3d3 and so
on... Does anyone knows a solution..? I am now using the folowing piece
of code:

<?php
$select = mysql_query("SELECT * FROM products ORDER BY name ASC LIMIT
$start,10");
for ($i=0;$i<mysql_num_rows($sql_id);$i++)
{
        $sql = mysql_fetch_assoc($select);
        //Table
        echo "
        <table cellpadding=\"2\" cellspacing=\"1\"
bgcolor=\"#ffffff\">\n
        <tr>\n
        <td bgcolor=\"#efefef\">".sql['products']."</td>\n//First row
        </tr>\n
        <tr>\n
        <td bgcolor=\"#efefef\">Second row</td>\n
        </tr>\n
        </table>\n";
}
?>

Well u get the idea i think, can anyone help me. Any help is greatly
appreciated.;-)

Regards,

Davy Obdam
mailto: [EMAIL PROTECTED] 


--- End Message ---
--- Begin Message ---
Davy,

Try using the modulus function to determine if you're in an odd row or an even row. 
You can then apply the one row color for one row and another for another row.

http://www.php.net/manual/en/language.operators.arithmetic.php

You'll need to create your look so that it run per row instead of per table (that's 
what it look like you're doing in your code).

-Flint

-----Original Message-----
From: Davy Obdam [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 03, 2002 4:48 PM
To: Php-Windows Mailing
Subject: [PHP-WIN] Alternate table rows


Hi people,..

I have a table wich is created with php and ofcourse the data comes from
a database. To make it more readable i would like to alternate the color
of each table row. For instance 1st row:#efefef 2nd row:#d3d3d3 and so
on... Does anyone knows a solution..? I am now using the folowing piece
of code:

<?php
$select = mysql_query("SELECT * FROM products ORDER BY name ASC LIMIT
$start,10");
for ($i=0;$i<mysql_num_rows($sql_id);$i++)
{
        $sql = mysql_fetch_assoc($select);
        //Table
        echo "
        <table cellpadding=\"2\" cellspacing=\"1\"
bgcolor=\"#ffffff\">\n
        <tr>\n
        <td bgcolor=\"#efefef\">".sql['products']."</td>\n//First row
        </tr>\n
        <tr>\n
        <td bgcolor=\"#efefef\">Second row</td>\n
        </tr>\n
        </table>\n";
}
?>

Well u get the idea i think, can anyone help me. Any help is greatly
appreciated.;-)

Regards,

Davy Obdam
mailto: [EMAIL PROTECTED] 



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

--- End Message ---
--- Begin Message ---
phpMyAdmin does it like this:

    $bgcolor          = ($i % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];

Obviously you'd have your $cfg['BgcolorOne'] and $cfg['BgcolorTwo'] set to
different colors, or change those variables right there.

-Dash

-----Original Message-----
From: Davy Obdam [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, October 03, 2002 4:48 PM
To: Php-Windows Mailing
Subject: [PHP-WIN] Alternate table rows


Hi people,..

I have a table wich is created with php and ofcourse the data comes from
a database. To make it more readable i would like to alternate the color
of each table row. For instance 1st row:#efefef 2nd row:#d3d3d3 and so
on... Does anyone knows a solution..? I am now using the folowing piece
of code:

<?php
$select = mysql_query("SELECT * FROM products ORDER BY name ASC LIMIT
$start,10");
for ($i=0;$i<mysql_num_rows($sql_id);$i++)
{
        $sql = mysql_fetch_assoc($select);
        //Table
        echo "
        <table cellpadding=\"2\" cellspacing=\"1\"
bgcolor=\"#ffffff\">\n
        <tr>\n
        <td bgcolor=\"#efefef\">".sql['products']."</td>\n//First row
        </tr>\n
        <tr>\n
        <td bgcolor=\"#efefef\">Second row</td>\n
        </tr>\n
        </table>\n";
}
?>

Well u get the idea i think, can anyone help me. Any help is greatly
appreciated.;-)

Regards,

Davy Obdam
mailto: [EMAIL PROTECTED] 



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi Davy

Use the modulo function to switch colours....

eg

echo '<table cellpadding="2" cellspacing="1" bgcolor="#ffffff">\n';

for ($i=0;$i<mysql_num_rows($sql_id);$i++) {    
        echo '<tr bgcolor="#'.(($i % 2 == 0) ? 'd3d3d3' : 'efefef').'">'.
           '<td>... etc etc

See what I mean?
HTH
Rich
-----Original Message-----
From: Davy Obdam [mailto:[EMAIL PROTECTED]]
Sent: 03 October 2002 16:48
To: Php-Windows Mailing
Subject: [PHP-WIN] Alternate table rows


Hi people,..

I have a table wich is created with php and ofcourse the data comes from
a database. To make it more readable i would like to alternate the color
of each table row. For instance 1st row:#efefef 2nd row:#d3d3d3 and so
on... Does anyone knows a solution..? I am now using the folowing piece
of code:

<?php
$select = mysql_query("SELECT * FROM products ORDER BY name ASC LIMIT
$start,10");
for ($i=0;$i<mysql_num_rows($sql_id);$i++)
{
        $sql = mysql_fetch_assoc($select);
        //Table
        echo "
        <table cellpadding=\"2\" cellspacing=\"1\"
bgcolor=\"#ffffff\">\n
        <tr>\n
        <td bgcolor=\"#efefef\">".sql['products']."</td>\n//First row
        </tr>\n
        <tr>\n
        <td bgcolor=\"#efefef\">Second row</td>\n
        </tr>\n
        </table>\n";
}
?>

Well u get the idea i think, can anyone help me. Any help is greatly
appreciated.;-)

Regards,

Davy Obdam
mailto: [EMAIL PROTECTED] 



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

--- End Message ---
--- Begin Message ---
Hi Davy,
I hope this helps.

best regards

<?php
$gray = 1;
$colors[0] = "#efefef";
$colors[1] = "#d3d3d3";

echo "<table cellpadding=\"2\" cellspacing=\"1\"bgcolor=\"#ffffff\">\n";
while ($row=mysql_fetch_array($result))
{
        $gray = !$gray;
        echo "<tr bgcolor=\"" . $colors[$gray] . "\">\n";
        echo "<td>" . row['products'] . "</td>\n";
        echo "</tr>\n";
}
echo "</table>\n";
?>

--- End Message ---
--- Begin Message ---
I have setup a web-frontend to the PHP.net Usenet/Mailing List Groups. 
Could anyone take a look and give me some recommendations on enhancements?

--- End Message ---
--- Begin Message ---
Sorry for the ID10T, the address is: http://www.phpdiscuss.com

--- End Message ---
--- Begin Message ---
try
"SELECT Files.Fileame, Products.ProdName FROM Products INNER JOIN Files
ON
Products.bid = Files.bid WHERE Products.ProdName LIKE ' * " . $ProdVar .
" * ' "

pls. remove spaces arnd * , i hv put them to make clearly visible single &
double quotes.

this may also work:

"SELECT Files.Fileame, Products.ProdName FROM Products INNER JOIN Files
ON
Products.bid = Files.bid WHERE Products.ProdName LIKE '\"*" . $ProdVar .
"*\""


regds,
-----Original Message-----
From: Williams, Dewey [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 04, 2002 02:29
To: [EMAIL PROTECTED]
Subject: Need SQL Help for PHP_WIN and ODBC/Access


HELP!

I am trying to write an sql statement to get data from my Access
database
through ODBC.  Everything works okay if I write a simple Select
statement,
but I need to write a statement like:

"SELECT Files.Fileame, Products.ProdName FROM Products INNER JOIN Files
ON
Products.bid = Files.bid WHERE Products.ProdName LIKE *" . $ProdVar .
"*";

I need the WHERE statement to use LIKE and wrap the variable $ProdVar in
*
so users can do a text search on the field.

This is where things get nasty.  I have tried every combination of * ""
.
LIKE etc and get no records returned or an Access ODBC driver error
saying
that there were "too few parameters. Expecting 1."

If anyone has a clue on how to write this statement, what is wrong with
the
above, what can be fixed, changed, etc in php to make it work ... I
would
really appreciate a hand.

Thanks

Dewey Williams
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Are you using a SMTP server on your lan?
Does the user [EMAIL PROTECTED] has authority to send e-mails from this
SMTP server?

[]'s

Ernani


"Georg Herland" <[EMAIL PROTECTED]> escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi!
>
> I'm trying to insert sending of a "notice-mail" whenever someone submits
to
> a buletinboard.
> I've checked the SMTP service with a mail-client, and sending mail works
> fine. When I try to send via the mail() function in my php script, it
fails
> with the following warning:
>
> "Warning: Failed to Receive in
> L:\root_www_leilighet\app_to_top_of_guestbook.php on line 32"
>
> wich refers to the line where I use "mail($email_recipient,
$email_subject,
> $text);"
>
> Should I impress a certain format to my variables contents?
>
> My php.ini looks like this:
>
> [mail function]
> ; For Win32 only.
> SMTP = 10.0.0.2 ; for Win32 only
>
> ; For Win32 only.
> sendmail_from = [EMAIL PROTECTED] ; for Win32 only
>
> Can anyone please help?
>
> Regards, Georg Herland
>
>
>


--- End Message ---
--- Begin Message ---
Hi

I've faced following problem running php 4.2.2 & 4.2.3 with apache 2.0.40 &
IIS and DBG php debugger, version 2.11.2, by Dmitri Dmitrienko

Opening a page with errors I've got message "Instruction at "0x1009553e"
referenced memory at "0x00000000". The memory can not be written"

Neither debugger fired (it is started and working) nor error message on the
screen shown.
I've fired DebugView and it shows that this happens after POST command.

The listing and the picture of the notice is available on request.

I'll appreciate your comments

All the best

Ivo


--- End Message ---

Reply via email to