marking of documents created in the last week with the word 'NEW '.

Hi all.

I have a mysql database with a table 'articles' containing the following (and other) fields:

  • category_name
  • Date_Created
  • level_name
  • title
  • Summary

I have set up a query to extract information on the statutes of the db. The questioning of basic works very well. It looks like this:

$r = @mysqli_query ($dbc, $q);

/ * display the results * /.

If ($r) {}

while ($row = mysqli_fetch_array ($r, MYSQLI_ASSOC)) {}

echo "< div class ="derniers_articles"> < strong class >: < facilities >". "." $row ["category_name"]. ' < br / > < strong > < em > posted on: < facilities > '. $row ["date_created"]. ' < br / > < level >: < facilities > '. $row ["level_name"]. "< /em > < h3 > '. $row ["title"]. "< / h3 > < class p ="last_ten"> < em >. $row ["Summary"]. ' < /em > < /p > < / div > ';

}

mysqli_free_result ($r);

} else {}

echo "< p > Prob get the info you need." < /p > ';

}

The query gives me result like this:

Category: News
Posted the: 2011-02-10 22:58:05
Level: 5, 6

Are you interested in politics?

There are too many young people who don't is interested not in politics. It's a secret United Nations pay no one. However, this isn't the case of Darcy Lonergan who, at 21 years old, the youngest is launching itself candidates who pour win a seat in the next Parliament.

Now, I want to mark all records created in the last week with the word 'NEW' so I inserted the line in bold in the following code:

$r = @mysqli_query ($dbc, $q);

/ * display the results * /.

If ($r) {}

While ($row = mysqli_fetch_array ($r, MYSQLI_ASSOC)) {}

echo "< div class ="derniers_articles"> < strong class >: < facilities >". "." $row ["category_name"];

If (DATE_SUB (CURDATE (), 7 DAYS INTERVAL < = DATE($row['date_created']))) echo "< strong > NEW < facilities > ';"

echo "< br / > < strong > < em > posted on: < facilities > '." $row ["date_created"]. ' < br / > < level >: < facilities > '. $row ["level_name"]. "< /em > < h3 > '. $row ["title"]. "< / h3 > < class p ="last_ten"> < em >. $row ["Summary"]. ' < /em > < /p > < / div > ';

}

mysqli_free_result ($r);

} else {}

echo "< p > Prob get the info you need." < /p > ';

}

.. but he throws this error:

Parse error: syntax error, unexpected T_LNUMBER in [file path] on line 31

31 is the "BOLD" line, I inserted. Can someone tell me what I am doing wrong? ("The date_created field is a timestamp like this ' 2011-01-08 18:06:39 '.)

I'm new to php so be nice!...

Thanks in advance.

Hugh

I think I'd be inclined to do in the query.

By example SELECT field1, Field2, field3, etc, IF (DATEDIFF (NOW (), dtCreated)< 7,="" 'new',="" '')="" as="" recordstatus="" from="">

Then echo just the value of the recordStatus for each record.

Tags: Dreamweaver

Similar Questions

  • How to create a document and insert the words and/or art on both sides of the page

    How to create a document and insert the words and/or art on both sides of the page

    How to create a document and insert the words and/or art on both sides of the page

    You create a document by using an application of word processor like Microsoft Word or Corel WordPerfect or OpenOffice Writer.  Think of it as a broad a page roll.

    When you print the document, you can print all pages of the document on one sheet of paper (the normal default value), or you can print on both sides of a sheet of paper.

    Some printers are capable of automatic double-sided printing.  With others, you print all the odd pages and then take the stack of paper, turn upside down and put it back into the printer to print all pages.  You need either to read your printer manual, or experiment a bit to determine if you need to re - organize the first last pages before printing the second side.

  • Can we have a space for documents, created by the members, approved by oracle dignitory and shared for all?

    Dear all,

    Is it possible that we have a space where all documents... created by members... regarded as valuable and approved by an authorized Oracle... and shared staff for all...

    This can be useful for generations to come... I strongly believe...

    Simply add to the question under: can we share with the Community (related to oracle) document which can be useful for someone..?

    and allow users to create community Documents

    Thank you and best regards,

    Séverine Suresh

    ... I agree!

    As Community Manager for the database and the spaces Dev App, I can

    work with you to post articles (in addition to blogging

    approach set out below.   If you want to publish an article, the first friend

    me, so we can communicate by message on the platform.

    And then create the document in your profile (HTML preferred) and cc: me as

    a collaborator. (@Laura Ramsey-Oracle)

    I can quickly passes in review (formatting and TM checks especially) and then I

    can move the article to the designated space.

    See you soon!

    LKR

  • The search in Vista for a document that contains the word or phrase

    I have a computer running Win XP, and with its search function, I can look for a document by typing a few words that I know are in it.

    I can't understand how to do this in Vista. Can someone tell me the answer?

    Open a folder.
    Click on "Organize", then "Options records and research."
    Click on the tab "search". Under "what happens to research."
    Always select "to the names of files search and content' or"in index locations, find the names of files and content, in locations not indexed, search file names only".
    Click OK

    teengeek.freehostingcloud.com Microsoft community contributor

  • How to configure a group of contact by e-mail when the words 'New group contact' do not appear in my toolbar?

    Help Vista says only "click New Contact Group on the toolbar."

    http://www.vista4beginners.com/missing-buttons-from-Windows-contacts-toolbar

    The tutorial above should help you.

    First, launch Windows Contacts. Then click on organize and select Properties.

    In the Properties of Contacts window, go to the Customize tab. Here you can choose the type of folder to use for the Windows Contacts. Most likely, it is now changed for all objects, Documents or the music.

    Under the text box that says "This file as a template to use", there is a selection area with the elements. Click on it, select Contacts , and then click OK.

    Your Windows Contacts toolbar now returns to normal.

    http://Windows.Microsoft.com/en-AU/Windows-Vista/managing-your-contacts

    Manage your contacts

    See you soon.

    Mick Murphy - Microsoft partner

  • find the version of the document of the last week

    I converted a file of pages to a doc.x I never downloaded from MS word. I'm new to mac. I used Finder and downloaded data recovery software that says I need to open in the application folder. I did not have the opportunity to browse any version or revert to a version prior to today. My screen shows two squares that is todays version on the left. We're older to the right and they don't offer anything that went when I logged in this afternoon. What I wrote Friday's gone! I would like to recover my work and not have to do it again, because it is due Wednesday.

    Is there a restore of the system as with windows?

    What specific version of Pages (Pages: pages) and OS X (Apple menu item: about this Mac) do you use?

    You do not convert a .docx Pages document, export you it. If you saved this document Pages at once, then autosave would enter in all 15 seconds on your local drive. The document Pages would still be around, unless you deleted, or could not save at all. If the original page document has disappeared, your options are:

    1. Open the Word document exported in Pages and save it again as a Pages document.
    2. If you have used the Time Time Machine built on an external drive backups, you can retrieve this document Pages (saved) since last Friday.

    Your new Mac and already downloaded the source data recovery software. If you have been regularly using your Mac since last Friday, there is a very high probability that your lost file has been replaced and storage used by the operating system. If you don't have software to restore data directly from the website of the supplier, then maybe it's another source of problems for you.

    Microsoft has not contributed to the OS X operating system, and it uses a solution of system restore as on Windows. As I said, if you have a sufficient capacity external hard drive which is used as a Time Machine backup, this is your best option for recovery.

    There are books available that can help to use a Mac as a Mac, and not as if it were a renamed Windows machine.

    If you are not running El Capitan, there are variants of these books for your version of Mac OS X. The computer section of your nearest Bookstore likely has these available for navigation.

  • I have been using InDesign for many years. Last week I suddenly discovered that I couldn't open a document by double-clicking on the desktop or wherever it was. Instead, I now find the document in some folder that is, click on it once, t

    I have been using InDesign for many years. Last week I suddenly discovered that I couldn't open a document by double-clicking on the desktop or wherever it was. Instead, now I have to find the document in the folder it's in, click on it once, and then click file in the bar at the top of the screen, go to open, then it will be open. Any ideas why this happened all of a sudden? In addition, in the bar on the top of a document, I can no longer change the Essentials to advanced or others. Seems to have everything that happened at the same time. Help appreciated please.

    First of all: this has nothing to do with InDesign, it has to do with your OS, so second: what operating system? Windows or Mac because to solve this problem, we need to know which. It's your operating system which has lost the connection with your program and document files.

  • Since last week, I have a PDF to WORD conversion problem.  All the documents, I have try to convert room conversion failed.  What is going on?  Thanks in advance and I look forward to hear from you.

    Nice day

    Since the last week I'm trouble conversion PDF to WORD.

    All documents I try to convert room conversion failure.

    What happens?

    Thanks in advance and I look forward at the hearing of your.

    Hi prates77,

    I'm sorry to hear that you are experiencing problems, file conversion. You receive a conversion error, regardless of the file you are trying to convert? The error occurs if you use the web interface, or convert by the reader? And a strange question: how many files you have stored in your Acrobat.com account? We have seen reports of this error when there are a large number of files stored in the folder root your Acrobat.com account.

    I can't wait to hear back on your part.

    Best,

    Sara

  • Reader Adobe XI updates last week. Reinstalled this morning. All previous saved pdf files are now forms of words asking the conversion? Creates problems for my business. Help, please?

    Reader Adobe XI updates last week. Reinstalled this morning. All previous saved pdf files are now forms of words asking the conversion? Creates problems for my business. Help, please?

    See http://windows.microsoft.com/en-us/windows/change-file-open-program#1TC=windows-7

    Another method: http://windows.microsoft.com/en-us/windows/change-default-programs#1TC=windows-7

  • Message: My windows Movie Maker has stopped working in the last week.

    Message: My windows stopped filmmaker working within the last week, began when the error message "the collections of file is not valid or is damaged. A new empty collections file has been created. When I try and import a file of any image type or otherwise, the file is not imported and the error message ends with "unknown error."
    So far WMM worked without fault, as full support has been removed for XP I am now unable to get all the patches. There is also no file conversion to allow to allow the import of files. Times, error message "class not registered"?
    What I'd really like is a copy of WMM version 5.1 (Build 2600 xpsp_sp3_gdr.101209 - 1647: Service Pack 3) Windows Movie Maker Version 2.1. 4028 0, I would continue with WMM, but am completely reluctant to upgrade to Windows 7. Someone at - he found a solution for the problem that I am facing.

    If you can open Movie Maker... try to go to... Tools / Options /.
    Compatibility on the left tab, click on the "all default settings"
    button / OK.

    Also... Do a restore of the system in Mode safe for a time
    before the problem started, may be worth a try.

    See the following articles:

    (306084) how to restore Windows XP to a
    previous state
    http://support.Microsoft.com/?kbid=306084

    How to restore a Windows XP system
    a previous state using system restore
    http://bertk.MVPs.org/

    (315222) a Description of the Safe Mode
    Boot into Windows XP options
    http://support.Microsoft.com/?kbid=315222

    How to start safe mode in Windows XP
    http://bertk.MVPs.org/html/SafeMode.html

    Good luck...

  • Start/end of last week, no matter the date execution this week

    Hello world

    I'm new to OBI and wanted to pick your brain on something that drives me crazy.

    I want to create a report that will run an aggregation for a date range that spans the last week (Sunday to Saturday), regardless of when his race in the week.

    Thus, for example. If today is 2016-02-09, then when I run the report at any time this week, it should automatically extract data from 31/01/2016-2016/02/06.

    Is it still possible? Appreciate guidance that can be provided.

    Thank you

    Try this as a SQL filter:

    "Your time Table '." " Your Date column.

    between

    TIMESTAMPADD (SQL_TSI_DAY, DAYOFWEEK (current_date)-6, CURRENT_DATE)

    and

    TIMESTAMPADD (SQL_TSI_DAY - DAYOFWEEK (current_date), CURRENT_DATE)

  • Calculate the last week of work

    Hello

    I use Oracle Database 11.2.1 and have a query that needs to filter on the date range of the last week of work. This must ignore Sat/Sun and works only on the days from Monday to Friday.

    If I just use sysdate - 7 this will include weekends, can anyone suggest a better solution to take into account only the last work week (Monday to Friday)

    Hello

    sliderrules wrote:
    ... If I just use sysdate - 7 this will include weekends, can anyone suggest a better solution to take into account only the last work week (Monday to Friday)

    So, if you run the query on Wednesday, May 15, you want that he only dates Monday, may 6 to Friday, may 10, inclusive; Isn't it?

    If so:

    WHERE   dt     >= TRUNC (SYSDATE, 'IW') - 7     -- 1 week ago Monday
    AND     dt     <  TRUNC (SYSDATE, 'IW') - 2     -- the Saturday after thar
    

    "Before Saturday' is identical to ' until and including Friday.
    This is not your NLS settings.

    I hope that answers your question.
    If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) and also publish outcomes from these data.
    Since the output depends on the time of execution, after a couple of different run times and results you want to obtain the same sample for each run-time data.
    Explain, using specific examples, how you get these results from these data.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).
    See the FAQ forum {message identifier: = 9360002}

  • How to calculate this column (the last week of the month)?

    I have a request where it shows a few months of calculations of sage

    ex. This report is for Dec-2010

    statement line. A reduced rate. Approved rate. Last week declined the rate |
    -------------------------
    Asia report | ------20%----- | -----45%-------- | --------4%------ |
    Africa report | ------44% -----| -----21%-------- | ------12%-------|

    I'm figuring the column rate declined last week . The logic is simply not coming to my mind.
    Can someone suggest me how can I calculate this?

    We'll see. This report at any time after the previous month running has closed...

    (1) TIMESTAMPADD (SQL_TSI_DAY, (DayOfMonth (CURRENT_DATE)) *-1, CURRENT_DATE) will give you the last day of the previous month.

    (2) TIMESTAMPADD (SQL_TSI_DAY, DAYOFWEEK (TIMESTAMPADD (SQL_TSI_DAY, (DayOfMonth (CURRENT_DATE)) *-1, CURRENT_DATE)) *-1, TIMESTAMPADD (SQL_TSI_DAY, (DayOfMonth (CURRENT_DATE)) *-1, CURRENT_DATE)) will give you the Saturday before the last week of the month.

    (3) TIMESTAMPADD (SQL_TSI_DAY, 1, TIMESTAMPADD (SQL_TSI_DAY, DAYOFWEEK (TIMESTAMPADD (SQL_TSI_DAY, (DayOfMonth (CURRENT_DATE)) *-1, CURRENT_DATE)) *-1, TIMESTAMPADD (SQL_TSI_DAY, (DayOfMonth (CURRENT_DATE)) *-1, CURRENT_DATE))) will give you the Sunday of the last week of the previous month.

    Now that you have the start of the last day of the previous week, you can create your filter... It will be "(between 3) and 1)" above... "

  • I got 'Triple 7 slots' for more than 2 years, with a bit of money on it, last week that it had to be updated, it would not update, so I removed it, the downloaded it again once, now my money is gone...

    I had "Extreme Triple Shots" on my MacBook Pro for over 2 years... He had to be updated, and then he never recovered last week, yesterday he disappeared from my Mac, so I downloaded again, now I don't have any money there, which was very little... What can I do to get my money back on...

    Ppenny

    < personal information deleted by host >

    Contact the developer of the app. This is not an Apple product.

  • For the last week or three Firefox updated two or three times for each update and sometimes for no apparent reason...

    For the last week or three Firefox updates two or three times for each update. Sometimes it refreshes without obvious reason. For example, I'll be in the middle of typing in the message forum block & it refreshes. Or by filling out an online form. Or simply viewing a page.

    You can check for problems caused by an extension that is not working properly.

    Start Firefox in Safe Mode to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance).

    • Do NOT click on the reset button on the startup window Mode without failure.

Maybe you are looking for

  • Unable to connect to MacAppStore

    Hello everyone! My problem is that I can't connect to the MacAppStore with my mid 2009 MacBook (OSX El Capitan). I read on the Internet that this problem is related to the inability of the softwere to display the serial number of my MacBook. I checke

  • Satellite 1900-101 - How to adjust the display?

    I have a type of laptop Toshiba 1900-101 and have been very satisfied since I bought it 3 years ago.One thing I fear is, that I could 'break' the socket plastic of the screen, since I have to use force to open / close. Could someone tell me how to ad

  • Interpolation on the FPGA

    Hello I would like to smooth out motion of my linear motor. For example, I would like to start a program on the cRIO in scan mode Let's say 1ms interval scan and then perform the interpolation between the points of output (for example, the wave of fi

  • SFC/scannow running on an XP Pro - SP3 without a CD XP Pro SP3 with the system files that SFC can recreatives__ form

    SFC/scannow running on an XP Pro - SP3 system without a CD with XP Pro SP3 files can be used by SFC form

  • License error - supposed to save Preview

    Adobe needs to make it easier to reverse a license error.I have a license by mistake two images I wanted to save only in my library. #79889449 and #63414244.Also, the only way I could contact you has been through this forum. It's too inefficient and