RE: [PHP] Dynamic Pages and Google ???
I too would be interested in learning what others on this list might have to say about this. Knowing how a search engine such as Google indexes a site or a page might be a good starting point in answering this debate: dynamic vs. static. Jeff So I was having a conversation with a manager/educator in the IT Industry :) In a discussion concerning search engines he stated how he dislikes dynamic web pages (PHP/ASP/JSP/CFM) because search engine spiders 'choke' on dynamic content or gives those pages a lower ranking. I can't see this as being true. I epically can't see the search spider "choking" on dynamic pages returning well-formed/valid HTML. Any thoughts? -- PHP General 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 General 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] MySQL Query Question
Hi, I have a couple questions... first, is there a notable MySQL General List like this one? Second, how do you write this query properly, or can it be done? select concat(date_format(date, "%W, %e %M %Y")," ",time) as date from TABLE order by date DESC; Thanks! Jeff -- PHP General 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] MySQL Query Question
The MySQL manual has a chapter on date/time factions. Or is it the 'order by' clause that's giving you trouble...? I assume that 'date' is a reserved word, so it may be confusing mysql. In which case, try using a different alias, like 'f_date". This works: select date_format(date, "%W, %e %M %Y") as date from table This doesn't: select concat(date_format(date, "%W, %e %M %Y")," ",time) as time_of_day I'm wondering if it is possible to use concat in this way and how if it is possible. Maybe this is a question better suited for the MySQL list. Thanks! Jeff -- PHP General 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] Display Formatted Query Results
Hi All, My apologies if this is too wordy. This is driving me nuts. I have very little experience or knowledge of PHP and MySQL but have been put in a position that requires me to build several applications that require me to figure them out. I am making progress, though. Here is my first delimit: I have a form page that looks like this: http://www.webtinker.com/fran_info.htm This form has several things going on. 1st, the first pull down list needs to reflect the same info as the two location descriptions. 2nd, the two locations "Round Table Discussion" will grow to an unknown number of entries over time so the two may become 6 or 8 or... My first big (for me) hurdle is to figure out how to get these to show up at the top of this form in order of the date with the closest one first. They need to be in the same format as they appear but with additional rows showing as more entries are made. The ones showing can't be past due, or, don't show past dates. What I have figured out so far is how to populate the pull down, how to make the admin form to fill in the needed info into the MySQL table and I have had limited success in displaying the meeting info at the top of the form. I just can't figure out how to make them wrap into groups of info, say with 5 entries of different meetings. Do I need a separate query for each row of info using the limit statement in the query or is there a way to do this using gulp arrays? I have just about every book available and just can't find a good example of this type of formatted query results. How do I approach this? Here is the table I am using: CREATE TABLE rnd_tbl ( id tinyint(10) DEFAULT '0' NOT NULL auto_increment, location varchar(100) NOT NULL, address varchar(45) NOT NULL, address2 varchar(45) NOT NULL, city varchar(50) NOT NULL, state char(2) NOT NULL, zip varchar(14) NOT NULL, day char(3) NOT NULL, date varchar(25) NOT NULL, time varchar(25) NOT NULL, phone varchar(15) NOT NULL, PRIMARY KEY (id) ); Many Thanks!! Short Circuit -- PHP General 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] Display Formatted Query Results
Thanks for the help, Brian. That'll give me something to go on. I definitely will need some assistance with this array stuff. I was actually able to do this (below) which got everything to a page - unformatted in any way - but when I tried moving it around (the arrays??) such as $my_row .= "$row[state]br"; to something like $my_row .= "$row[city][state][zip]br"; it obviously failed. Is there something I need to do with the output of the while statement beyond what I have done or is there a simple way to get that info formatted to look like the current page? Thanks ? include ("../config/common.inc.php"); # connect database $link = mysql_connect($host, $user, $pass) or die("Connection failed: " . mysql_error()); # select table mysql_select_db($db_name) or die("Database selection failed [$db_name]: " . mysql_error()); # send query $sql = "SELECT * FROM rnd_tbl ORDER BY date"; $result = mysql_query($sql) or die("Query failed: " . mysql_error()); ? html head title/title /head body ? while ($row = mysql_fetch_array($result)) { $my_row = "div align=\"center\"\n"; $my_row .= "Round Table Discussionbr"; $my_row .= "$row[day]br"; $my_row .= "$row[address] [address2]br"; $my_row .= "$row[address2]br"; $my_row .= "$row[location]br"; $my_row .= "$row[city]br"; $my_row .= "$row[state]br"; $my_row .= "$row[city]br"; $my_row .= "$row[zip]br"; $my_row .= "$row[date]br"; $my_row .= "$row[time]br"; $my_row .= "$row[phone]br"; $my_row .= "/divbr"; echo "$my_row\n"; } ? /body /html Hi Jeff, @ 8:52:10 PM on 4/14/2001, Jeff Holzfaster wrote: My apologies if this is too wordy. A little confusing, but here we go. If this makes no sense what so ever, maybe someone else can provide a better way of doing what you're describing here. I have a form page that looks like this: http://www.webtinker.com/fran_info.htm This form has several things going on. 1st, the first pull down list needs to reflect the same info as the two location descriptions. That's easy. If you're getting the two locations' data from a mysql table, just reuse the same information for the pull down. Is 'location' in your table the 'label' for that meeting? Ie., is 'location' in your SQL below going to be something like "Chicogo Round Table Discussion"? If not, add another column for that label and use that for the listings above the form, and use that again for the select. 2nd, the two locations "Round Table Discussion" will grow to an unknown number of entries over time so the two may become 6 or 8 or... My first big (for me) hurdle is to figure out how to get these to show up at the top of this form in order of the date with the closest one first. They need to be in the same format as they appear but with additional rows showing as more entries are made. The ones showing can't be past due, or, don't show past dates. For the date column in your SQL below, use either the value of time() from PHP, or use one of the built in mysql date functions like DATETIME. Then you'll just need to compare the current date to the ones listed in the table and only show the meetings dated for the current day or greater. If the expired meetings won't change, you could leave them in the table and only modify the date down the road. If they're a one time thing, you can drop the expired listings as you're doing your date check for the current/future meetings to extract from the table. Since you're reusing the 'location,' your drop down matching the top listings should already be taken care of. What I have figured out so far is how to populate the pull down, how to make the admin form to fill in the needed info into the MySQL table and I have had limited success in displaying the meeting info at the top of the form. You'll just need to read the data using mysql_fetch_array() or mysql_fetch_object(). There are examples of those in the manual at http://www.php.net. (enough to do what you're wanting to do.) As you read the data, you can print rows with two cells. If you have 5 meeting entries, you'll end up with a 2 x 3 table with the 2nd cell in the last row being empty. Since you'll be reusing the 'location label' from the rows' printing, your select should be populated with the same information. I just can't figure out how to make them wrap into groups of info No idea what you mean by 'groups of info' unless you
RE: [PHP] Display Formatted Query Results
Teemu, thanks for the input. I tried this with somewhat modified code (added all the fields) and perhaps you saw what I did on my last post to the list. I have actually been able to get the same results as this. I'm a little confused about how to get the info in the 'for' section to format to look the way I need it and to 'wrap' with only two sets of results to a row. Using the way you show has the disadvantage of leaving blank rows if data is not available for that row plus, I don't see how to rearrange the results to look right. I mean, how do you put city, state, zip on the same line or how do you get "$city Round Table Discussion" in there? Are Thanks!! Here is yours after I made my attempt: while( $row = mysql_fetch_array( $result )){ $data[] = array( location = $row[1], address= $row[2], address2 = $row[3], city = $row[4], state= $row[5], zip = $row[6], day = $row[7], date = $row[8], time = $row[9], phone= $row[10] ); } for ( $i = 0; $i count( $data ); $i++ ){ print("brbrSet $i:br"); print( $data[$i][location]."br"); print( $data[$i][address]."br"); print( $data[$i][address2]."br"); print( $data[$i][city]." "."Round Table Discussion"."br"); print( $data[$i][city]."br"); print( $data[$i][state]."br"); print( $data[$i][zip]."br"); print( $data[$i][day]."br"); print( $data[$i][date]."br"); print( $data[$i][time]."br"); print( $data[$i][phone]."br"); } try something like this... $db = "database_name"; $q = "select * from md_tbl"; $rs = mysql_query( $db, $q ); while( $row = mysql_fetch_array( $rs )){ $data[] = array( LOCATION= $row[1], ADDR= $row[2], ADDR2 = $row[3] ); } for ( $i = 0; $i count( $data ); $i++ ){ print("Set $i:br"); print( $data[$i][LOCATION]."br"); print( $data[$i][ADDR]."br"); print( $data[$i][ADDR2]."br"); } sorry 'bout typos , it's getting late here ;-) Hope this helps. cheers Teemu Pentinsaari At 19:52 14.4.2001 -0500, you wrote: Hi All, My apologies if this is too wordy. This is driving me nuts. I have very little experience or knowledge of PHP and MySQL but have been put in a position that requires me to build several applications that require me to figure them out. I am making progress, though. Here is my first delimit: I have a form page that looks like this: http://www.webtinker.com/fran_info.htm This form has several things going on. 1st, the first pull down list needs to reflect the same info as the two location descriptions. 2nd, the two locations "Round Table Discussion" will grow to an unknown number of entries over time so the two may become 6 or 8 or... My first big (for me) hurdle is to figure out how to get these to show up at the top of this form in order of the date with the closest one first. They need to be in the same format as they appear but with additional rows showing as more entries are made. The ones showing can't be past due, or, don't show past dates. What I have figured out so far is how to populate the pull down, how to make the admin form to fill in the needed info into the MySQL table and I have had limited success in displaying the meeting info at the top of the form. I just can't figure out how to make them wrap into groups of info, say with 5 entries of different meetings. Do I need a separate query for each row of info using the limit statement in the query or is there a way to do this using gulp arrays? I have just about every book available and just can't find a good example of this type of formatted query results. How do I approach this? Here is the table I am using: CREATE TABLE rnd_tbl ( id tinyint(10) DEFAULT '0' NOT NULL auto_increment, location varchar(100) NOT NULL, address varchar(45) NOT NULL, address2 varchar(45) NOT NULL, city varchar(50) NOT NULL, state char(2) NOT NULL, zip varchar(14) NOT NULL, day char(3) NOT NULL, date varchar(25) NOT NULL, time varchar(25) NOT NULL, phone varchar(15) NOT NULL, PRIMARY KEY (id) ); Many Thanks!! Short Circuit -- PHP General 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 General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the