[PHP] Re: strlen question
sorry, i'm not a coder.that means nothing to me.. try isset() how? "Mr. Bogomil Shopov" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > try isset() > > > Bogomil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to change SCRIPT_FILENAME syntax??
I have the following code on my page: $page = $_SERVER['SCRIPT_FILENAME']; // gets current url this is part of a INSERT INTO mysql/php script. when the table gets populated, the entire url string is there: /home/com/sitename/html/secure/sales2.php I would like it to read: sales2.php How would I change the syntax to eliminate all the other information? thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: repeating data from one column until data from another column changes
"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > date('m') was not parsed by php as it was in the string. Syntax > highlighting would help you see it. Try: > > "SELECT * FROM NewsArchive WHERE YEAR(date) = '" . date('Y') . "' AND > MONTH(date) ='" . date('m') . "' ORDER BY sort DESC"; Well, still not working...but maybe closer? Not getting an error message, just not returning any data. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: repeating data from one column until data from another column changes
"Daniel Clark" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Are you looping through the record set? i thought I was, but it isn't working!! here is the code with all of the latest suggestions. start code at top of document: end top code start code in body of document: //this is where I would like to list the titles of the articles for the current month E-News //this is where i want the list to be title and article for the current month top end code I didn't hand write much of thisdreamweaver writes a lot of it behind the scenes.i'm not much of a code writer, just get into small needs here and there...REALLY appreciate all of you trying to help me!!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: repeating data from one column until data from another column changes
- Original Message - > > start code at top of document: > > > > > mysql_select_db($database_jpike, $jpike); > > $query_rsENews = 'SELECT * FROM NewsArchive WHERE YEAR(date) = ' . > date('Y') > > . ' AND MONTH(date) = ' . date('m') . ' ORDER BY sort DESC'; > > $rsENews = mysql_query($query_rsENews, $jpike) or die(mysql_error()); > > $row_rsENews = mysql_fetch_assoc($rsENews); > > The above line is already fetching the first row from the result. Is this > what you want at this point of the script? If not put // in front to out > ocmment it. > > > $totalRows_rsENews = mysql_num_rows($rsENews); > > Please print out $totalRows_rsENews and post the value. > > Have you checked if you have articles with a May date? > > Torsten the above code is what dreamweaver writes when I create a connection to the table in the database... there 192 records total and no may records as of yet. I do not understand why that is pertinent...? there are 10 articles listed for aprilbut every month varies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: repeating data from one column until data from another column changes
no. - Original Message - From: "Daniel Clark" <[EMAIL PROTECTED]> Newsgroups: php.general To: "msa" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, May 04, 2004 5:02 PM Subject: Re: [PHP] Re: repeating data from one column until data from another column changes > Are you getting any output? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: repeating data from one column until data from another column changes
definitely "Daniel Clark" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Netscape browser? > In your browser have you checked View Source to see it table data is there? > > > no. > > > > - Original Message - > > From: "Daniel Clark" <[EMAIL PROTECTED]> > > > > > >> Are you getting any output? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: repeating data from one column until data from another column changes
"Php" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > If you have no may articles then there will be no records returned. > > Just change the . date('m') to the actualy month you want if not the > current month. except if I have to specify the specific month I want, then every month I have to go in and change the codeI would rather be able to have the code "know" that it just needs to look for the most recent date in the table...whatever that may becan that be done? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: repeating data from one column until data from another column changes
when i take out the WHERE clause, I get ALL 192 titles in the upper right side and ALL 192 titles and descriptions in the main body..which is almost what i want...minus about 180 titles and articles "Daniel Clark" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Just for right now, go ahead a make the date change, or elimate the date > range to get SOMETHING to come out. > > > >> Just change the . date('m') to the actualy month you want if not the > >> current month. > > > > > > except if I have to specify the specific month I want, then every month I > > have to go in and change the codeI would rather be able to have the > > code > > "know" that it just needs to look for the most recent date in the > > table...whatever that may becan that be done? > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: repeating data from one column until data from another column changes
"Php" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Why not change the code back, then just add an article for the month of may > and see if it comes up? i am trying to automate this so I don't have to look at it againclient updates the pages and I won't be getting paid beyond this... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] the code angain....
the code again... at top of document (with strange WHERE clause removed.. in body of document: E-News top -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] WHERE clause...getting closer
$query_rsENews = 'SELECT * FROM NewsArchive WHERE YEAR(datePublished) = ' . YEAR('NOW'()) . ' AND MONTH(datePublished) = ' . MONTH('NOW'()) . ' ORDER BY sortBy DESC'; this is supposed to return only the records that have the current month and year in the datePublished record. the above code got a parse error this code: $query_rsENews = 'SELECT * FROM NewsArchive WHERE YEAR(datePublished) = ' . YEAR(NOW()) . ' AND MONTH(datePublished) = ' . MONTH(NOW()) . ' ORDER BY sortBy DESC'; got this error: Fatal error: Call to undefined function: year() any ideas, anyone? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] WHERE clause...getting closer
Curt, thanks, your code works perfectly. Can I ask you two questions? 1. I am not sure what you mean by adding an index. I looked in the mySQL help files and from what I can figure, I have already done that... 2. Now that the code actually works, we have come up with an issue. When the current e-news newsletter (the table holds the current AND the archive enews newsletters) doesn't get updated until a few days into the month, then the page will be blank until she puts articles in for that month..is there a way to just say "show me the articles with the most current dates" ? thanks "Curt Zirzow" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > * Thus wrote msa ([EMAIL PROTECTED]): > > > $query_rsENews = 'SELECT * FROM NewsArchive >WHERE datePublished >= DATE_FORMAT(NOW(), "%Y-%m-01") > ORDER BY sortBy DESC'; > > And add an index on the datePublished column. You'll notice a > considerable speed difference. > > Curt > -- > "I used to think I was indecisive, but now I'm not so sure." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] tweeking WHERE clause
I am trying to query a table that consists of e-news artilces. in the table are the following fields: ID, sortBy, datePublished, title, description. You can see a fake sample of this at: www.aiaky.org/articles.htm I have the following $query on the actual e-news page: $query_rsENews = 'SELECT * FROM NewsArchive WHERE datePublished >= DATE_FORMAT(NOW(), "%Y-%m-01") ORDER BY sortBy ASC'; what this is doing is returning only those records whose 'datePublished' = the current mont. it works great...butthere's always a butt.. i really need it to return those records of the most recent date, as the most recent date might be last month and there may be no records for this month...leaving my page blank. Is there a way to do this? so many of you have already gotten me to this point...thanks!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] tweeking WHERE clause
there are a different number of articles each month...:( "Daniel Clark" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hey Melissa. > > Will your articles always had a certain number (for each section) each > month? If so a ORDER BY and LIMIT would work. > > Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] tweeking WHERE clause
That would work. "Daniel Clark" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > OK how about. > > Do a count of this monthes articles, if NONE, then run another query to > select the previous months articles. Note, this would only "publish" this > or last monthes records. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] hide elements on page based on cookie
I have three tags that I need to either hide or show, based on access level defined in a cookie. the three buttons are: secure (to show when accessLevel = 1) sales (to show when accessLevel = 2) login (to show when there is no cookie) I have had some success with to following code: _ http://atricure.com/test/secure/secure.php');r eturn document.MM_returnValue" onMouseOver="pviiClassNew(this,'menutextoverdown')" onMouseOut="pviiClassNew(this,'menutext')" value="secure"> http://atricure.com/test/secure/sales.php');re turn document.MM_returnValue" onMouseOver="pviiClassNew(this,'menutextoverdown')" onMouseOut="pviiClassNew(this,'menutext')" value="sales"> " METHOD="POST" name="UserLoginForm" id="UserLoginForm"> Login: Password: ___ the problem that I am having is that when I change one of the strlen comparisons, it affects the others..so i get one or two of the parameters to work and the other doesn't.i change the third and it works, but now the other two don't. With the above code, it works for: login and securebut not for sales. If i change the sales comparison, then the other two don't work anymoreyee gads, very frustrating. Thanks for any helpI am desperate!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: hide elements on page based on cookie
no, I am not sure of that.I played with that code snippet from someone else. how do I check for the value instead? would the reason why they aren't working be because of checking for length and not value? > > Are you sure you want to check the string length of the cookie instead of > its value? > > Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] trim() white space from record set
I created a search form with multiple search parameters. It returns nothing if there is a space after their text entry or if they hit return in the text area. $coltitle_rsResults = "0"; if (isset($_GET['Title'])) { $coltitle_rsResults = (get_magic_quotes_gpc()) ? $_GET['Title'] : addslashes($_GET['Title']); where do i put the trim? trim($_GET['Title']correct? I have tried it in several places to no avail. THANKS!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] trim() white space from record set
thanks for the helpthe syntax is wrong somewhereparentasis.colonsI don't know where the error is $coltitle_rsResults = "0"; if (isset($_GET['Title'])) { $_GET['title'] = trim($_GET['title']); $coltitle_rsResults = (get_magic_quotes_gpc()) ? $_GET['Title'] : addslashes($_GET['Title']); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] trim() white space from record set
aaah, simple for you.. I have to fit that line into the following: $colauthor_rsResults = "0"; if (isset($_GET['Author'])) { $colauthor_rsResults = (get_magic_quotes_gpc()) ? $_GET['Author'] : addslashes($_GET['Author']); } and don't know how to do that.also, I am using GET "Justin Patrin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Wed, 21 Jul 2004 15:00:39 -0400, melissa atchley > <[EMAIL PROTECTED]> wrote: > > I have a search page with three parametersauthor, title and journal. > > > > I typed in "heart" in the title text area and hit the return button, > > thinking it would activate the search button. it merely did a carriage > > return in the text area, then I hit the submit button. > > > > the result came back as null, as there is not title that has the word > > "heart" in it with a carriage return afterwards. if I take our the return, > > it finds the heart articles. > > > > I tried a similar thing in the author section, putting a space after the > > author name...same empty results. > > > > I would like to fix that. > > > > Ok, this is simple. Assuming you pass in author as the variable author > in POST... > > $author = trim($_POST['author']); > > > > > > > > > - Original Message - > > > > > What exactly are you trying to do? trim() only rmeoves whitespace from > > > the beginning and end of a string. It doesn't work on a record / array > > > and it doesn't pull all whitespace from the string. > > > > > > $str = 'whitespace before and after'; > > > $trimmedStr = trim($str); > > > $noWhitespaceStr = preg_replace('/\s/', '', $str); > > > > > > On Wed, 21 Jul 2004 13:54:22 -0400, melissa atchley > > > <[EMAIL PROTECTED]> wrote: > > > > thanks guys...but with all of the >>>> in the message, the syntax is not > > > > coming through. > > > > > > > > I have tried adding the trim() line in several ways and it isn't > > working. > > > > can you help me with the exact syntax? > > > > > > > > > > > > > > > > - Original Message - > > > > From: "Justin Patrin" <[EMAIL PROTECTED]> > > > > To: "John W. Holmes" <[EMAIL PROTECTED]> > > > > Cc: "msa" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > > > > Sent: Wednesday, July 21, 2004 1:12 PM > > > > Subject: Re: [PHP] trim() white space from record set > > > > > > > > > On Wed, 21 Jul 2004 12:41:55 -0400, John W. Holmes > > > > > <[EMAIL PROTECTED]> wrote: > > > > > > msa wrote: > > > > > > > > > > > > > I created a search form with multiple search parameters. It > > returns > > > > nothing > > > > > > > if there is a space after their text entry or if they hit return > > in > > > > the text > > > > > > > area. > > > > > > > > > > > > > > $coltitle_rsResults = "0"; > > > > > > > if (isset($_GET['Title'])) { > > > > > > $_GET['title'] = trim($_GET['title']); > > > > > > > $coltitle_rsResults = (get_magic_quotes_gpc()) ? $_GET['Title'] > > : > > > > > > > addslashes($_GET['Title']); > > > > > > > > > > > > > > where do i put the trim? > > > > > > > > > > > > See above. You have to assign the result of trim() to a variable. My > > > > > > crystal ball (it's back off of loan now) says that was the issue. :) > > > > > > > > > > > > > > > > Ughdamn Perl and its auto-assign and $_ features. It makes people > > > > > assume things... > > > > > > > > > > > > > > > -- > > > > > DB_DataObject_FormBuilder - The database at your fingertips > > > > > http://pear.php.net/package/DB_DataObject_FormBuilder > > > > > > > > > > paperCrane --Justin Patrin-- > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > DB_DataObject_FormBuilder - The database at your fingertips > > > http://pear.php.net/package/DB_DataObject_FormBuilder > > > > > > paperCrane --Justin Patrin-- > > > > > > -- > DB_DataObject_FormBuilder - The database at your fingertips > http://pear.php.net/package/DB_DataObject_FormBuilder > > paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strlen question
I have successfully hidden some parts of a form based on items being blank with following code: 0) { ?> (with the help of this forum!!) the form is separated into 5 sections and if there are no items filled out in that section, then i need to hide the title too. I have been playing around with the syntax and am not having any success...any suggestions? here is a sample of what i am trying: 0) { ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php