[PHP-DB] Re: Table Output Question
Bastien Koert <[EMAIL PROTECTED]> wrote: > Simply put, you create a couple of css classes that make the row look the > way you want and then > > while ($rows = mysql_fetch_array($result)) > { > $color = ($counter % 2 ==0) ? "rowclass1" : "rowclass2" ; > > echo "..."; > > } > > Its essentially the same thing, just neater and lets you concentrate on the > code for the table without the worry about the way the row looks > > Bastien > Thanks again for the information. Jeff -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Table Output Question
Bastien Koert <[EMAIL PROTECTED]> wrote: > > $row1 = "FF"; > $row2 = "AA"; > $counter = 0; > > while ($rows = mysql_fetch_array($result)) > { > $color = ($counter % 2 ==0) ? $row1 : $row2 ; > > echo "..."; > > } > > > bastien > > > ps: a class css definition would be better here Thanks for the help. After reading a couple of the responses, I couldn't believe that I did not think of this. I don't know a lot about CSS yet (just purchased a book). But, could you share with me about the ps line? Thanks again for you help. Jeff -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Table Output Question
Micah Stevens <[EMAIL PROTECTED]> wrote: > > You don't have to output two rows.. just do this: > > $color = "red"; // init first color. > while ($row = mysql_fetch_assoc($data)) { >if ($color == "red") { >$color = "blue"; >} else { >$color = "red"; >} >?> >.. > > } > > -Micah Great, thanks for the help and information. May I ask, how does PHP know to change the color? What do the "?"'s do in ""? Thanks for the help. Jeff -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Table Output Question
I have a table, where each line is the output of a query from a MySQL database. I do not use borders, so the page is a little difficult to read sometimes. Is it possible, or how do I, alternate the background color of each row when I output it? My code is like this: while (query) { } I am not sure how to output two rows in the same while loop. Thanks for any help you can offer me. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Forms Question
Hello, Here is the code I have: while ($row=mysql_fetch_array($result)) { $store=$row["store"]; $jobdesc=$row["jobdesc"]; echo ""; echo "Store: Signal Hill Reseda Orange West Covina Riverside Norwalk Fountain Valley Pasadena Redondo Beach San Bernardino Kearny Mesa San Marcos Chino Corporate Office "; echo ""; echo ""; } Is want I am trying to do possible? I want the value which is stored in $store to automatically fill in on the drop down list. But, for some reason it is defaulting to the first option, and not using the value that is in the database. Can I use a drop down menu, or should I just go to radio buttons? Thanks, Jeff -- Jeff Grossman ([EMAIL PROTECTED]) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Parsing Error
I keep getting a Parsing Error on line 1 error with the following page. What am I doing wrong? http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd";> xxx \n"; echo " Store Job Desc \n"; while (($row = mysql_fetch_array($result))) { $store=$row["store"]; $jobdesc=$row["jobdesc"]; $rowid=$row["rowid"]; echo " $store $jobdesc Modify/ Delete \n; } echo ""; mysql_free_result($result); ?> Return To Main Menu Add An Item -- Jeff Grossman ([EMAIL PROTECTED]) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Re: Installing PHP3 with mysql support on MOSXS
[EMAIL PROTECTED] (Fabian Pichler) wrote: >Hello together > >I'm a real newbie on PHP/Mysql. >I'm trying to get PHP/mysql to work together on my MOSXS 1.0-2 Server. >Has anyone done this before? > >My problem is the mysql support (--with-mysql=/usr/local/mysql) in PHP. >If I compile the PHP with this configure option apache 1.3.12 (or 1.3.9) >doesn't start anymore. > >I get the following error entry in the error_log of apache eache time I >try to start apache. >with apache 1.3.12: >>dyld: /usr/local/sbin/httpd Undefined symbols: >>_strtol >with apache 1.3.9: >> [Mon Sep 25 07:49:35 2000] [emerg] dyld found undefined symbol: _strtol >> Aborting. > >Has anyone an idea what's going wrong? Try running the configure with --with-mysql and not including the path. That will use the internal mysql libraries that PHP has. It worked for me. Jeff -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Re: Installing PHP3 with mysql support on MOSXS
Fabian Pichler <[EMAIL PROTECTED]> wrote: >My problem is the mysql support (--with-mysql=/usr/local/mysql) in PHP. >If I compile the PHP with this configure option apache 1.3.12 (or 1.3.9) >doesn't start anymore. Try just using the --with-mysql option and not supplying a path. It works for me. Jeff -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Parsing Error
Thanks Larry. Now I am getting a printf too few arguments error on this line: printf("mailto:[EMAIL PROTECTED]?subject=$store\%20$jobdesc\";>$jobdesc\n"); Thanks, Jeff "Larry Rivera" <[EMAIL PROTECTED]> wrote: >After a brief look it appears that your call to mysql_query is incorrect >" after the query then "," then the link resource > >-Original Message- >From: Jeff Grossman [mailto:[EMAIL PROTECTED]] >Sent: Saturday, July 07, 2001 6:23 PM >To: [EMAIL PROTECTED] >Subject: [PHP-DB] Parsing Error > >I keep getting the following error: > >Warning: Supplied argument is not a valid MySQL result resource in >/home/httpd/html/stats/jobs/listing.php on line 33 > >Warning: Supplied argument is not a valid MySQL result resource in >/home/httpd/html/stats/jobs/listing.php on line 43 > >when I try to display the following webpage. What am I doing wrong? > >"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd";> > > > Title > > >$hostName="localhost"; >$userName="jeff"; >$password="jeff"; >$databaseName="jobs"; >$tableName="listings"; > >// connnect to the database >if (!($link=mysql_pconnect($hostName, $userName, $password))) { > DisplayErrMsg(sprintf("error connecting to host %s by user >%s", $hostName, $userName)); > exit(); >} > >// select the database >if (!mysql_select_db($databaseName, $link)) { > DisplayErrMsg(sprintf("Error in selecting %s database", >$databaseName)); > DisplayErrMsg(sprintf("error:%d %s", mysql_errno($link), >mysql_error($link))); > exit(); >} > >// send the SQL queries > >$result=mysql_query("SELECT * FROM listings WHERE store='West Covina', >$link"); > >// return how many rows >$num_rows=mysql_num_rows($result); >// check if greater than zero >if($num_rows!=0) { >printf("West Covina HREF=\"../test/stores.php#WC\">address"); >while ($row=mysql_fetch_array($result)) { >$store=$rowid["store"]; >$jobdesc=$rowid["jobdesc"]; >printf("HREF=\"mailto:[EMAIL PROTECTED]?subject=$store\%20$jobdesc\";>$jobdesc>\n"); >} >} >mysql_free_result($result); > >?> > > > > > >Thank you, >Jeff >--- >Jeff Grossman ([EMAIL PROTECTED]) --- Jeff Grossman ([EMAIL PROTECTED]) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Parsing Error
I keep getting the following error: Warning: Supplied argument is not a valid MySQL result resource in /home/httpd/html/stats/jobs/listing.php on line 33 Warning: Supplied argument is not a valid MySQL result resource in /home/httpd/html/stats/jobs/listing.php on line 43 when I try to display the following webpage. What am I doing wrong? http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd";> Title West Covina address"); while ($row=mysql_fetch_array($result)) { $store=$rowid["store"]; $jobdesc=$rowid["jobdesc"]; printf("mailto:[EMAIL PROTECTED]?subject=$store\%20$jobdesc\";>$jobdesc\n"); } } mysql_free_result($result); ?> Thank you, Jeff --- Jeff Grossman ([EMAIL PROTECTED]) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]