[PHP-DB] PHP - DB2 / odbc_connect() failed
Hello All, I have IBM DB2 v7.2 FP5 on a Windows 2000 Server A Linux Web server running with Apache/PHP4 And IBM DB2 V7.2 Client Install on it. When I try to use odbc_connect($dbname, $user,$password); I received the message: Warning: SQL error: , SQL state ¿Ë ?=z@éÿ¿ÛË ?=z@?=z in SQLConnect in /svr/jerry/web/myphppage.php But on the Linux server from the command line I don't have any problem to connect to the database... Do you have any idea what is the problem and how to solve it ? Thanks. Jerry -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] mssql_fetch_row() failed to get data with float data type ??
I use PHP 4.0.6 on linux (Red Hat 7.0) to access MS SQL Server 7.0. I can connect to database and get the correct data with char or int data type, but it showed '0' if data type is float or real. Did any one know why it happened ? Thanks in advance. William Hung -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Bindbyname error in solaris
On Wed, Mar 06, 2002 at 10:59:33PM +0500, Mohammad Saad wrote: Hello I have PHP4.10 on solaris with oci8 support. everything seems to work well. Oracle support is working fine. but I am getting an error when I am trying OCIBindByName to bind a variable to an out variable of a stored procedure. I have checked this code on php4.10 on windows 2k with same database and it works well. I get the value of the out variable in my binded variable of PHP script. .Only PHP on solaris is giving me the error, any ideas why? here is the code and the error $getcardvalidity = begin customer.scratch_check ('$serial','$code1','$code2',:amount);end;; $cardstmt = OCIParse($conn,$getcardvalidity); OCIBindByName ( $cardstmt, :amount, $amount,4); OCIExecute($cardstmt,OCI_DEFAULT); Warning: OCIStmtExecute: Error while trying to retrieve text for error ORA-03113 03113, 0, end-of-file on communication channel // *Cause: // *Action: your db-connection died. please try to connect from your windows box to this db to see if the problem is PHP or oracle related! tc -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Best way to store/retrieve content??
I'm writing some content management scripts for an online magazine. Many articles are formatted in a similar way, but some have a unique page layout that includes grids of photos, tables, etc. I'm not sure if the best way to store content is in a database so it can be flowed into an article template, or to simply lay out the page as HTML, surrounding it with a simple include(header.php) and include(footer.php) for header/footer HTML and graphics. For articles that require things like tables, it would be a pain to have to write this HTML by hand or lay it out in Dreamweaver then copy and past the code into the database field (using an Admin web form). Or, is it prudent to set up a custom table in the databse for each type of content so that a matching template can be used to format the pages properly without having to include all the HTML in the database with the content itself? Hope this makes some sense. Just trying to figure out the best way to tackle this. All input is appreciated! Monty -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Best way to store/retrieve content??
Could you use PDFs? -Natalie -Original Message- From: Monty [SMTP:[EMAIL PROTECTED]] Sent: Thursday, March 07, 2002 2:31 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Best way to store/retrieve content?? I'm writing some content management scripts for an online magazine. Many articles are formatted in a similar way, but some have a unique page layout that includes grids of photos, tables, etc. I'm not sure if the best way to store content is in a database so it can be flowed into an article template, or to simply lay out the page as HTML, surrounding it with a simple include(header.php) and include(footer.php) for header/footer HTML and graphics. For articles that require things like tables, it would be a pain to have to write this HTML by hand or lay it out in Dreamweaver then copy and past the code into the database field (using an Admin web form). Or, is it prudent to set up a custom table in the databse for each type of content so that a matching template can be used to format the pages properly without having to include all the HTML in the database with the content itself? Hope this makes some sense. Just trying to figure out the best way to tackle this. All input is appreciated! Monty -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Best way to store/retrieve content??
I would try to use CSS, instead of complex tables. That way, you only need to store the structural html in the database and the layout is handled by CSS--floating images and flowing text are really easy with CSS. -Original Message- From: Monty [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 07, 2002 11:31 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Best way to store/retrieve content?? I'm writing some content management scripts for an online magazine. Many articles are formatted in a similar way, but some have a unique page layout that includes grids of photos, tables, etc. I'm not sure if the best way to store content is in a database so it can be flowed into an article template, or to simply lay out the page as HTML, surrounding it with a simple include(header.php) and include(footer.php) for header/footer HTML and graphics. For articles that require things like tables, it would be a pain to have to write this HTML by hand or lay it out in Dreamweaver then copy and past the code into the database field (using an Admin web form). Or, is it prudent to set up a custom table in the databse for each type of content so that a matching template can be used to format the pages properly without having to include all the HTML in the database with the content itself? Hope this makes some sense. Just trying to figure out the best way to tackle this. All input is appreciated! Monty -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Best way to store/retrieve content??
I will be using CSS for other thing, such as paragraph formatting, but, not sure how to use it for creating tables and flowing text around graphics. Can CSS really do all that? Still not sure if this will work because I don't want the writers to have to type in any HMTL code at all if possible. Here's a good example: One article may be a simple interview with some images (this is easy to enter into a database). But another article about new beauty products has a grid of images plus a short blurb about each product next to the photo. This requires more intricate formatting with HTML than an interview does. I don't have a problem creating separate templates for these special types of articles, but, it looks like I'd also have to set up separate database tables to store this article data differently than it would be stored for a simple interview. But, it would be better if all content was centrally stored in one table to make searches better/easier...or am I expecting too much from just one content table? What to do, what to do! From: [EMAIL PROTECTED] (Court Shrock) Newsgroups: php.db Date: Thu, 7 Mar 2002 11:31:20 -0800 To: 'Monty' [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [PHP-DB] Best way to store/retrieve content?? I would try to use CSS, instead of complex tables. That way, you only need to store the structural html in the database and the layout is handled by CSS--floating images and flowing text are really easy with CSS. -Original Message- From: Monty [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 07, 2002 11:31 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Best way to store/retrieve content?? I'm writing some content management scripts for an online magazine. Many articles are formatted in a similar way, but some have a unique page layout that includes grids of photos, tables, etc. I'm not sure if the best way to store content is in a database so it can be flowed into an article template, or to simply lay out the page as HTML, surrounding it with a simple include(header.php) and include(footer.php) for header/footer HTML and graphics. For articles that require things like tables, it would be a pain to have to write this HTML by hand or lay it out in Dreamweaver then copy and past the code into the database field (using an Admin web form). Or, is it prudent to set up a custom table in the databse for each type of content so that a matching template can be used to format the pages properly without having to include all the HTML in the database with the content itself? Hope this makes some sense. Just trying to figure out the best way to tackle this. All input is appreciated! Monty -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Best way to store/retrieve content??
Hi Natalie, no, PDFs won't work. I need to display the content as an HTML page. From: [EMAIL PROTECTED] (Natalie Leotta) Newsgroups: php.db Date: Thu, 7 Mar 2002 14:32:57 -0500 To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Best way to store/retrieve content?? Could you use PDFs? -Natalie -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Best way to store/retrieve content??
In theory, if your writers are using a word processor such as Word you could try just saving as HTML and seeing if that works. I doubt they'd appreciate it if you asked them to write in FrontPage, but that would give you what you need too. If these ideas don't work you may want to browse other magazines online (if you go to fashion ones then they should have the tables you talked about). You could try magazines like Cosmo, Seventeen, etc. and see if you can get any feel for what they are developing in. I only came up with the PDFs because one site I go to uses them and we use them for some of our web publications for the NCI. Good luck! -Natalie -Original Message- From: Monty [SMTP:[EMAIL PROTECTED]] Sent: Thursday, March 07, 2002 2:46 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Best way to store/retrieve content?? Hi Natalie, no, PDFs won't work. I need to display the content as an HTML page. From: [EMAIL PROTECTED] (Natalie Leotta) Newsgroups: php.db Date: Thu, 7 Mar 2002 14:32:57 -0500 To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Best way to store/retrieve content?? Could you use PDFs? -Natalie -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Best way to store/retrieve content??
Hi I have done a similar thing, and found that you can store just the text in the database. I added 'Short_content' which was a leader, and some other fields for management. I designed a few templates in Dreamweaver and embeded a function to display the content in the page eg trtd?php print_content($ContentID) ?/td/tr The function basically pulls the content from the database and prints it. You can just print the text, or you can add HTML in the function to give a particular layout. You can use the same principal to link images, or you can hard code them into the page. If you want to be more sophisticated you can use a number of templates and store the one to use in the record, giving. display.php?contentID=1234 -query db to get template for 'Article 1234' -output 'template_1.htm' which has the correct layout, and the function for this article embedded in it CREATE TABLE S_content ( ContentID int(11) NOT NULL auto_increment, Title varchar(100) NOT NULL default '', Description varchar(250) default NULL, Short_content text, Full_content text, UserID int(11) default NULL, Start_date date default NULL, End_date date default NULL, End_actionID int(11) NOT NULL default '0', Template_file varchar(50) , PRIMARY KEY (ContentID), KEY ContentID(ContentID), ) HTH Peter --- Excellence in internet and open source software --- Sunmaia www.sunmaia.net [EMAIL PROTECTED] tel. 0121-242-1473 --- -Original Message- From: Monty [mailto:[EMAIL PROTECTED]] Sent: 07 March 2002 19:31 To: [EMAIL PROTECTED] Subject: [PHP-DB] Best way to store/retrieve content?? I'm writing some content management scripts for an online magazine. Many articles are formatted in a similar way, but some have a unique page layout that includes grids of photos, tables, etc. I'm not sure if the best way to store content is in a database so it can be flowed into an article template, or to simply lay out the page as HTML, surrounding it with a simple include(header.php) and include(footer.php) for header/footer HTML and graphics. For articles that require things like tables, it would be a pain to have to write this HTML by hand or lay it out in Dreamweaver then copy and past the code into the database field (using an Admin web form). Or, is it prudent to set up a custom table in the databse for each type of content so that a matching template can be used to format the pages properly without having to include all the HTML in the database with the content itself? Hope this makes some sense. Just trying to figure out the best way to tackle this. All input is appreciated! Monty -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Best way to store/retrieve content??
Actually, CSS is very powerful--way more than simple html. One drawback is that CSS1 did not include any support for tables directly, but the generic controls work nicely, there just is no way to say table align=center in CSS1. A great book that taught me a lot about CSS is http://www.oreilly.com/catalog/css/ --I'd lone it to you if you were local. I think it would be feasible to store all content in one db: just use your templates to convert the articles to appropriate markup and then store the results. (I am departing from html) The interview: [input_form] Template: selectInterview/select Question: input value=How are you doing? Answer: input value=Fine, thanks for asking [form_submittal] $content = _header($template); foreach (question) { $content .= p class='question'span class='us'Us:/span$question/p p class='answer'span class='them'Them:/span$answer/p; } insertArticle($content); The beauty product: [input_form] Template: selectpicture/select Picture: input file=pic1.jpg Description: textareaJust imagine yourself all prettied up like this glorious person/textarea Transition: textareaAnd now that brings us to some really cool whale-inard products/textarea Picture: input file=pic2.jpg Description: textareaWe promise that no animals were harmed during the making./textarea [form_submittal] $content = _header($template); foreach(picture) { $content .= p class='picture'img class='pic$count' src='$file'$description/p; if ($transition != '') $content .= p class='$transition_count'$transition/p; } ...anyway, you get the idea.this is a rather simple approach--but, you could combine something like this with an output template to get really good results. -Original Message- From: Monty [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 07, 2002 11:46 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Best way to store/retrieve content?? I will be using CSS for other thing, such as paragraph formatting, but, not sure how to use it for creating tables and flowing text around graphics. Can CSS really do all that? Still not sure if this will work because I don't want the writers to have to type in any HMTL code at all if possible. Here's a good example: One article may be a simple interview with some images (this is easy to enter into a database). But another article about new beauty products has a grid of images plus a short blurb about each product next to the photo. This requires more intricate formatting with HTML than an interview does. I don't have a problem creating separate templates for these special types of articles, but, it looks like I'd also have to set up separate database tables to store this article data differently than it would be stored for a simple interview. But, it would be better if all content was centrally stored in one table to make searches better/easier...or am I expecting too much from just one content table? What to do, what to do! From: [EMAIL PROTECTED] (Court Shrock) Newsgroups: php.db Date: Thu, 7 Mar 2002 11:31:20 -0800 To: 'Monty' [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [PHP-DB] Best way to store/retrieve content?? I would try to use CSS, instead of complex tables. That way, you only need to store the structural html in the database and the layout is handled by CSS--floating images and flowing text are really easy with CSS. -Original Message- From: Monty [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 07, 2002 11:31 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Best way to store/retrieve content?? I'm writing some content management scripts for an online magazine. Many articles are formatted in a similar way, but some have a unique page layout that includes grids of photos, tables, etc. I'm not sure if the best way to store content is in a database so it can be flowed into an article template, or to simply lay out the page as HTML, surrounding it with a simple include(header.php) and include(footer.php) for header/footer HTML and graphics. For articles that require things like tables, it would be a pain to have to write this HTML by hand or lay it out in Dreamweaver then copy and past the code into the database field (using an Admin web form). Or, is it prudent to set up a custom table in the databse for each type of content so that a matching template can be used to format the pages properly without having to include all the HTML in the database with the content itself? Hope this makes some sense. Just trying to figure out the best way to tackle this. All input is appreciated! Monty -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List
[PHP-DB] Can I attach an image to a newsgroup post?
Is it possible to attach an image to a post here in order to better illustrate a point? If so, how?? Thanks! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Best way to store/retrieve content??
Hi Peter, thanks a lot for your advice. I think where I'm stuck is how to best store certain types of articles in a data table. Interviews would be easy, because it's just paragraphs of text with an inline photo here and there. The more structured articles are trickier and I can't figure out how to use the same Article table for all articles. Using the example I gave in a previous message, here's a rough page layout of one of these structured articles: +---+ +---+ +---+ | image 1 | | image 2 | | image 3 | +---+ +---+ +---+ Short paragraphShort paragraphShort paragraph of text under of text under of text under the image. the image. the image. +---+ +---+ +---+ | image 4 | | image 5 | | image 6 | +---+ +---+ +---+ Short paragraphShort paragraphShort paragraph of text under of text under of text under the image. the image. the image. If I have one field in the Article table for full_content (which works just fine for interviews), how could I enter the above type of article into this table so that the template will know to separate each element text block and match it up with the associated image? Is this a matter of writing a special parsing function that would take the following from the full_content field... img src=image1.jpg Short paragraph of text under the image. img src=image2.jpg Short paragraph of text under the image. ...and format break it down into an array so it can then be formatted on the page as illustrated above? My real block is how the set up the database more than the templates. As I mentioned, I'm trying to keep all articles in one data table so searches can be easily done on all articles. Thanks! Monty From: [EMAIL PROTECTED] (Peter Lovatt) Newsgroups: php.db Date: Thu, 7 Mar 2002 20:11:00 - To: Monty [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [PHP-DB] Best way to store/retrieve content?? Hi I have done a similar thing, and found that you can store just the text in the database. I added 'Short_content' which was a leader, and some other fields for management. I designed a few templates in Dreamweaver and embeded a function to display the content in the page eg trtd?php print_content($ContentID) ?/td/tr The function basically pulls the content from the database and prints it. You can just print the text, or you can add HTML in the function to give a particular layout. You can use the same principal to link images, or you can hard code them into the page. If you want to be more sophisticated you can use a number of templates and store the one to use in the record, giving. display.php?contentID=1234 -query db to get template for 'Article 1234' -output 'template_1.htm' which has the correct layout, and the function for this article embedded in it CREATE TABLE S_content ( ContentID int(11) NOT NULL auto_increment, Title varchar(100) NOT NULL default '', Description varchar(250) default NULL, Short_content text, Full_content text, UserID int(11) default NULL, Start_date date default NULL, End_date date default NULL, End_actionID int(11) NOT NULL default '0', Template_file varchar(50) , PRIMARY KEY (ContentID), KEY ContentID(ContentID), ) HTH Peter --- Excellence in internet and open source software --- Sunmaia www.sunmaia.net [EMAIL PROTECTED] tel. 0121-242-1473 --- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Best way to store/retrieve content??
Hi Court, thanks a lot for your advice. I am fairly new to PHP, so, I'm a little slow in understanding some of the suggestions in your detailed post. From what I gather, you suggested that an Admin script be created to basically build each portion of an article piece by piece, which would then be combined and stored in a single field in the Articles data table. Is that right? The only thing I can see being a problem with this method is if the writer needs to go back and edit the article. Unless I strip out all HTML and parse the sections out into individual fields, they would have to contend with all the HTML code written into the article content field. I'd like to reduce the amount of HTML stored with the article content in the database as much as possible so that writers don't have to worry about anything but the most basic codes. Here's one idea I have. In the database field, the article content may look something like this: [START-BLOCK] [IMG=photos/image1.jpg] This product will make your skin feel silky smooth. [END-BLOCK] [START-BLOCK] [IMG=photos/image2.jpg] New from Nivea, a lotion that moisturizes and protects from the sun. [END-BLOCK] ...which I can then parse to lay the article out like this... +---+ +---+ +---+ | image 1 | | image 2 | | image 3 | +---+ +---+ +---+ Short paragraphShort paragraphShort paragraph of text under of text under of text under the image. the image. the image. +---+ +---+ +---+ | image 4 | | image 5 | | image 6 | +---+ +---+ +---+ Short paragraphShort paragraphShort paragraph of text under of text under of text under the image. the image. the image. If this is a doable and good way to go, then my next question is, which PHP string function would be the best to use for parsing custom codes (like [IMG=) into actual HTML codes? Thanks! Monty From: [EMAIL PROTECTED] (Court Shrock) Newsgroups: php.db Date: Thu, 7 Mar 2002 12:16:07 -0800 To: 'Monty' [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [PHP-DB] Best way to store/retrieve content?? Actually, CSS is very powerful--way more than simple html. One drawback is that CSS1 did not include any support for tables directly, but the generic controls work nicely, there just is no way to say table align=center in CSS1. A great book that taught me a lot about CSS is http://www.oreilly.com/catalog/css/ --I'd lone it to you if you were local. I think it would be feasible to store all content in one db: just use your templates to convert the articles to appropriate markup and then store the results. (I am departing from html) The interview: [input_form] Template: selectInterview/select Question: input value=How are you doing? Answer: input value=Fine, thanks for asking [form_submittal] $content = _header($template); foreach (question) { $content .= p class='question'span class='us'Us:/span$question/p p class='answer'span class='them'Them:/span$answer/p; } insertArticle($content); The beauty product: [input_form] Template: selectpicture/select Picture: input file=pic1.jpg Description: textareaJust imagine yourself all prettied up like this glorious person/textarea Transition: textareaAnd now that brings us to some really cool whale-inard products/textarea Picture: input file=pic2.jpg Description: textareaWe promise that no animals were harmed during the making./textarea [form_submittal] $content = _header($template); foreach(picture) { $content .= p class='picture'img class='pic$count' src='$file'$description/p; if ($transition != '') $content .= p class='$transition_count'$transition/p; } ...anyway, you get the idea.this is a rather simple approach--but, you could combine something like this with an output template to get really good results. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Can I attach an image to a newsgroup post?
on 3/7/02 3:34 PM, Monty at [EMAIL PROTECTED] appended the following bits to my mbox: Is it possible to attach an image to a post here in order to better illustrate a point? If so, how?? Thanks! Please don't upload the image (or any other attachments) to the list/newsgroup. It's better to place it on a public web server somewhere and then use a link to it in your post, like this: http://example.com/somefolder/my_image.jpg Or http://example.com/somefolder/my_php_file.phps Sincerely, Paul Burney http://paulburney.com/ ?php If ($your_php_version 4.1.2) { upgrade_now(); // to avoid major security problems /* Please see http://security.e-matters.de/advisories/012002.html */ ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Best way to store/retrieve content??
Valid point--I was thinking that in a news article or such, the content is mostly already created and edited, just needed to be posted by someone not familar with HTML. I like your idea about the [start-stop block]. To maybe merge what Paul said with your idea, you could store the name of the function handler (generates the appropriate content) inside the []. [renderProducts] [renderImage] /photos/image1.jpg [/renderImage] [renderDescription] This product will make your skin feel silky smooth. [/renderDescription] [renderImage] /photos/image2.jpg [/renderImage] [renderDescription] New from Nivea, a lotion that moisturizes and protects from the sun. [/renderDescription] that way, the main handler (renderProducts) is always at the top. The main handler would then strip out the data/sub-routine calls (renderImage, renderDescription) and pass that data to the function along with a context variable like $op or something so that the same functions could be used to display to the screen and to edit the results thanks to $op (add/modify/view, etc...). The function renderImage could contain an internal counter to when to display the next row. Creating this source data would require something similar to my last post, except replacing the html with the appropriate []. Of course, what we are really doing is xml. Maybe should just do xml: renderProducts product image /photos/image1.jpg /image description This product will make your skin feel silky smooth. /description /product product image /photos/image2.jpg /image description New from Nivea, a lotion that moisturizes and protects from the sun. /description /product /renderInterview In parsing the first example, I would probably use preg_match and regular expressions. In parsing the xml, I would use php's xml parser. Hope this helps a little more-- Court -Original Message- From: Monty [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 07, 2002 1:04 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Best way to store/retrieve content?? Hi Court, thanks a lot for your advice. I am fairly new to PHP, so, I'm a little slow in understanding some of the suggestions in your detailed post. From what I gather, you suggested that an Admin script be created to basically build each portion of an article piece by piece, which would then be combined and stored in a single field in the Articles data table. Is that right? The only thing I can see being a problem with this method is if the writer needs to go back and edit the article. Unless I strip out all HTML and parse the sections out into individual fields, they would have to contend with all the HTML code written into the article content field. I'd like to reduce the amount of HTML stored with the article content in the database as much as possible so that writers don't have to worry about anything but the most basic codes. Here's one idea I have. In the database field, the article content may look something like this: [START-BLOCK] [IMG=photos/image1.jpg] This product will make your skin feel silky smooth. [END-BLOCK] [START-BLOCK] [IMG=photos/image2.jpg] New from Nivea, a lotion that moisturizes and protects from the sun. [END-BLOCK] ...which I can then parse to lay the article out like this... +---+ +---+ +---+ | image 1 | | image 2 | | image 3 | +---+ +---+ +---+ Short paragraphShort paragraphShort paragraph of text under of text under of text under the image. the image. the image. +---+ +---+ +---+ | image 4 | | image 5 | | image 6 | +---+ +---+ +---+ Short paragraphShort paragraphShort paragraph of text under of text under of text under the image. the image. the image. If this is a doable and good way to go, then my next question is, which PHP string function would be the best to use for parsing custom codes (like [IMG=) into actual HTML codes? Thanks! Monty From: [EMAIL PROTECTED] (Court Shrock) Newsgroups: php.db Date: Thu, 7 Mar 2002 12:16:07 -0800 To: 'Monty' [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [PHP-DB] Best way to store/retrieve content?? Actually, CSS is very powerful--way more than simple html. One drawback is that CSS1 did not include any support for tables directly, but the generic controls work nicely, there just is no way to say table align=center in CSS1. A great book that taught me a lot about CSS is http://www.oreilly.com/catalog/css/ --I'd lone it to you if you were local. I think it would be feasible to store all content in one db: just use your templates to convert the articles to appropriate markup and then store the results.
RE: [PHP-DB] Best way to store/retrieve content??
I like your idea about the [start-stop block]. To maybe merge what Paul said with your idea, you could store the name of the function handler (generates the appropriate content) inside the []. I meant Peter :) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Monitor files
I am wondering if there is a way to monitor the contents of a directory for changes and if a change is made, to record the name of the file changed the date etc and send it to a database and also an email... has anyone every seen anything like this and if so are there any intrustion detection open source s/w that is commercially available for download etc. Maybe a tutorial on the subject would be great. Thanks Jas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] looking for a particular script, or how-to...
I'm looking for a script that will give me this - a web page that shows who is currently accessing my mysql database. If it could provide other details that would be great too. I'm not sure how to go about setting this up. I couldn't find any mysql command that shows the users accessing the database. Any suggestions? -- Chip Wiegand Computer Services Simrad, Inc www.simrad.com [EMAIL PROTECTED] There is no reason anyone would want a computer in their home. --Ken Olson, president, chairman and founder of Digital Equipment Corporation, 1977 (They why do I have 7? Somebody help me!)
[PHP-DB] counting of values in one field possible with one sql statement?
Hi there, I am wondering if it would be possible to get the amount of different values in one sql command. E.g.: field age: 0,3,5,5,2,3 Sql querry should return how often 3 occurs. Which would be 2. And as well the other values... 1 for agestructure 2 becuase it occures only once. I wrote following querry $stmt= SELECT COUNT(*) AS c FROM $T5 WHERE age = 4 ; $row = db_get_row2($stmt); $age_4 = $row-c; This returns only the value for 4. To get all values (10 different ones) I would have to make 10 querrys, right? Is there a faster way? Thanx for any help, Andy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Best way to store/retrieve content??
Hi I am not an expert but could XML be an answer? The author(s) gets a screen designed by you, looking like the screen you will publish, with type in text boxes (name=short_text1, name=short_text2 etc )where the text will be. When you store the input from the form you end up with article pic1pic1.jpg/pic1 short_text1Short paragraph of text under pic1 /short_text pic2pic2.jpg/pic2 short_text2Short paragraph of text under pic2/short_text2 long_textlots of stuff, lots of stuff, lots of stuff, lots of stuff, lots of stuff, /long_text /article which allows you to add any structure to the data, but store all the article in a single searchable text field. Otherwise maybe you could use two tables. CREATE TABLE Article ( ArticleID int(11), Title char(50), Start_date date default NULL, End_date date default NULL, End_actionID int(11) NOT NULL default '0', Template_file varchar(50) , ) CREATE TABLE Article_components ( ArticleID int(11), Component_name char(50), Content text ) Article_components might contain :- +--+++ |ArticleID | Component_name | Content| +--+++ |123 | pic1 | pic1.jpg | +--+++ |123 | short_text1| Short text etc etc | +--+++ |123 | pic2 | pic2.jpg | +--+++ |123 | short_text2| Short text etc etc | +--+++ Which you could search and return the articleID, which you could then use to retive the article in full. To display, loop thro the result trtd$row[pic1]/tdtd$row[pic2]/tdtd$row[pic3]/td/tr trtd$row[short_text1]/tdtd$row[short_text2]/tdtd$row[short_ text3]/td/tr Just a few thoughts Be interested to know how you do this in the end. Peter --- Excellence in internet and open source software --- Sunmaia www.sunmaia.net [EMAIL PROTECTED] tel. 0121-242-1473 --- -Original Message- From: Monty [mailto:[EMAIL PROTECTED]] Sent: 07 March 2002 20:51 To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Best way to store/retrieve content?? Hi Peter, thanks a lot for your advice. I think where I'm stuck is how to best store certain types of articles in a data table. Interviews would be easy, because it's just paragraphs of text with an inline photo here and there. The more structured articles are trickier and I can't figure out how to use the same Article table for all articles. Using the example I gave in a previous message, here's a rough page layout of one of these structured articles: +---+ +---+ +---+ | image 1 | | image 2 | | image 3 | +---+ +---+ +---+ Short paragraphShort paragraphShort paragraph of text under of text under of text under the image. the image. the image. +---+ +---+ +---+ | image 4 | | image 5 | | image 6 | +---+ +---+ +---+ Short paragraphShort paragraphShort paragraph of text under of text under of text under the image. the image. the image. If I have one field in the Article table for full_content (which works just fine for interviews), how could I enter the above type of article into this table so that the template will know to separate each element text block and match it up with the associated image? Is this a matter of writing a special parsing function that would take the following from the full_content field... img src=image1.jpg Short paragraph of text under the image. img src=image2.jpg Short paragraph of text under the image. ...and format break it down into an array so it can then be formatted on the page as illustrated above? My real block is how the set up the database more than the templates. As I mentioned, I'm trying to keep all articles in one data table so searches can be easily done on all articles. Thanks! Monty From: [EMAIL PROTECTED] (Peter Lovatt) Newsgroups: php.db Date: Thu, 7 Mar 2002 20:11:00 - To: Monty [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [PHP-DB] Best way to store/retrieve content?? Hi I have done a similar thing, and found that you can store just the text in the database. I added 'Short_content' which was a leader, and some other fields for management. I designed a few templates in Dreamweaver and embeded a function to display the content in the page eg
[PHP-DB] Re: counting of values in one field possible with one sqlstatement?
Yes, in fact there is a faster way, GROUP BY SELECT COUNT(*) AS c, age FROM $T5 GROUP BY age This will give you two columns 'c' and 'age' which will be the count (the number of) and each age. So from your example (0,3,5,5,2,3) we'd get: c age 1 0 2 3 2 5 1 2 That's easier, right? Good Luck, Frank On 3/7/02 4:40 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: From: Andy [EMAIL PROTECTED] Reply-To: Andy [EMAIL PROTECTED] Date: Fri, 8 Mar 2002 01:06:09 +0100 To: [EMAIL PROTECTED] Subject: counting of values in one field possible with one sql statement? Hi there, I am wondering if it would be possible to get the amount of different values in one sql command. E.g.: 0,3,5,5,2,3 Sql querry should return how often 3 occurs. Which would be 2. And as well the other values... 1 for agestructure 2 becuase it occures only once. I wrote following querry $stmt= SELECT COUNT(*) AS c FROM $T5 WHERE age = 4 ; $row = db_get_row2($stmt); $age_4 = $row-c; This returns only the value for 4. To get all values (10 different ones) I would have to make 10 querrys, right? Is there a faster way? Thanx for any help, Andy -- Frank Flynn Poet, Artist Mystic -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Soft-Linking and includes
I'm on a red hat system, and I've soft-linked two directories: /www/dir1/subdir /www/dir2/subdir -- /www/dir1/subdir Now, inside subdir is a file that tries to include(../info.php); which prints out some information about the file paths and my database stuff. So there's: /www/dir1/info.php /www/dir1/subdir/includer.php /www/dir2/info.php /www/dir2/subdir -- /www/dir1/subdir Now, when I run /www/dir2/subdir/includer.php, it SHOULD include the file ../info.php which translates into /www/dir2/info.php. However, the symbolic linking seems to have messed it up, and instead of running dir2's info.php, it seems to think it is in dir1, and instead includes dir1's info.php file. Has anyone run into this and/or know a fix for it? Thanks! - Jonathan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Email Validation
How would I go about doing the DNS look up part? Markus Lervik [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Tuesday 12 February 2002 06:19, CrossWalkCentral wrote: I am working on a form that I have in php and am looking for some advise on form validation or specifically email address validation so i can insure that some one has put in a properly formatted email address Well. something like if (!eregi(^[A-Za-z0-9\_-]+@[A-Za-z0-9\_-]+.[A-Za-z0-9\_-]+.*, $email)) { echo $email doesn't seem to be a valid e-mail address!; } would do the job. Of course, that doesn't stop people from entering a false email address. You could do a DNS-lookup to see if the domain-part of the address really exists, too. Cheers, Markus -- Markus Lervik Linux-administrator with a kungfoo grip Vaasa City Library - Regional Library [EMAIL PROTECTED] +358-6-325 3589 / +358-40-832 6709 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MySQL Result
Hi there everyone, I have delete working perfectly by doing the following: include(connectionstart.php); mysql_query (DELETE FROM emaillist WHERE EMail = '$email' ); However, how do I return a true or false flag whether the row was deleted or not? I basically need to know how to do a 0 or 1 I guess once the row has been deleted or if the specified email address wasn't found. Thanks for your help everyone. Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Split a long db record into multiple pages
On Friday 08 March 2002 10:12, CrossWalkCentral wrote: I am interested in receiving some help on this one as well. Will [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Does anyone know how to limit a long record, like a news article that has 5 pages? I want to limit it so it displays the first page then at the bottom it prints: 1 2 3 4 5 6 7 then when you click 2 or the right arrow it displays the second page of the record? The following code assumes/requires: $result : an array containing the results from a query the number of items in the array is the number of rows returned from the query. $frm[batchpos] : a value that is passed from page to page containing the position at which to begin displaying the current page $frm[batchsize] : a predefined variable to control how many records are displayed per page # if ($result) { ## Extract only the relevant batch of results to display ## ($frm[batchpos] - $frm[batchpos]+$frm[batchsize]) ## Display the results navigation bar $RESULT_COUNT = count($result); $result = array_slice($result, $frm['batchpos'], $frm['batchsize']); $BATCHES = ($RESULT_COUNT / $frm['batchsize']); $RESULT_LINK = Results: ; for ($i = 0; $i $BATCHES; $i++) { $disp_start = ($i * $frm['batchsize']) + 1; $disp_end = $disp_start + $frm['batchsize'] - 1; if ($disp_end $RESULT_COUNT) { $disp_end = $RESULT_COUNT; } $link_batchpos = $i * $frm['batchsize']; if ($disp_start != $disp_end) { $link = [$disp_start - $disp_end] ; } else { $link = [$disp_start]; } if ($frm['batchpos'] != $link_batchpos) { $link = a href='$PHP_SELF?. rawurlencode(frm[category]).=.rawurlencode($frm['category']).. rawurlencode(frm[batchpos]).=.rawurlencode($link_batchpos).'. $link./a; } $RESULT_LINK .= $link; } } echo $RESULT_LINK; # The above is for reference only. Obviously you would need to change things to suit your situation and needs. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Love is like the measles; we all have to go through it. -- Jerome K. Jerome */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] ora-12705
Hi to Everybody, I try to set env parameter (NLS_LANG) of Oracle but I got 'ORA-12705' message. Does anybody know ,why? I use PHP and Apache's last releases and Oracle 8.0.5. Best reagrds. _ Yusuf AKYOL ICQ#:361342 Current ICQ status: SMS: (Send an SMS message to my ICQ): +2783142361342 More ways to contact me: http://wwp.icq.com/361342 _ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php