extracting the Month and yer from table and add it to new ta

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ihabgr
Forum Newbie
Posts: 13
Joined: Fri Jul 11, 2008 11:26 am

extracting the Month and yer from table and add it to new ta

Post by ihabgr »

Hello please helps me to solve this problem
I’m having data base call "ih_all" and I have table cold ih_old this has fields call review and other field is ih1_id
The other table is ih_ new and has afild called last_visit and other filde ih_1id
___________________________________________
inside the fild review i have text their in this text their is a date like "march ,2008" and the the number in ih1_id
I wanna take this date from review and convert it to time stamp like 03/2008 and the add it to the other table in the filed last visit at where the ih1_id=ih1_id
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: extracting the Month and yer from table and add it to new ta

Post by jaoudestudios »

Store a unix timestamp in the database (approx 8 digit number), from that you can pull out any date format you want with the date() function.
ihabgr
Forum Newbie
Posts: 13
Joined: Fri Jul 11, 2008 11:26 am

Re: extracting the Month and yer from table and add it to new ta

Post by ihabgr »

No this not what i ment
I have one file include text in it i wana extract the dat and add it in another fild in another table her sample of the text i wanna extract the date from the and of the text "January 2003"
_________________
<p><strong>2006 UPDATE: </strong>Lisa Bianco, principal when Insideschools last visited the East Village Community School, left the school during the 2005-06. Her replacement, Robin Williams, came from Region 9 where she had been the school\'s regional support specialist for several years and had a \"good working relationship\" with the school, according to school officials.</p>

<p><strong>2003 REVIEW:</strong></p>

<p>East Village Community School, formerly Lower East Side School, was the first parent-teacher collaborative school in its area. Today, it is being revived by a dedicated principal and active parents.</p>

<p>The brainchild of residents attracted to the neighborhood for its arts, diversity, and affordable housing, East Village was modeled on nurturing, progressive schools. Unfortunately, remaining a parent-teacher collaborative proved difficult, and the school\'s location next to East River Drive kept away many parents dependent on public transportation. Parent support dwindled and the principal\'s office experienced unwelcome turnover.</p>

<p>All that changed in September, 2002, when the school gave itself a new name, moved west, and elevated Lisa Bianco to head of the school. A long time faculty member and educator well grounded in the progressive methods that the school had been using, the new director has proved a dynamic leader who encourages ongoing professional development, the \"writing process,\" constructivist math, hands-on science, and inquiry-based social studies.</p>

<p>The school has mixed-aged classes, so kids stay with the same teacher for two years. This creates what Bianco calls \"multiple points of entry to the curriculum.\" Kids learn math through the TERC method, rather than the curriculum chosen for the city by the chancellor, because Bianco says it accommodates differing abilities. \"We celebrate individuals\' strengths and send the message to children that everyone has different strengths and everyone can contribute,\" she says.</p>

<p>EVCS puts great emphasis on community. The first/second grade classes produce books about community members they interview; build neighborhoods out of blocks and devise an economic system to run them; and write about how acts of kindness can make a difference. Younger students assist special education students whose school, PS 94, is also housed in the building. Older kids volunteer in nursing homes and elsewhere. All grades participate in town meetings.</p>

<p>In upper grades, students study New York City\'s early history, ancient Greece and Egypt, and \"Renaissance and Revolution.\" They choose their own research project and learn skills like note taking. The scientific method of observation and recording is stressed. Arts surround the students, who take daily art or theater classes and participate in collaborations with Ballet Hispanico and other groups. Students who need extra help may attend an \"After School Challenge\" program.</p>

<p>One downside to the school is its setting: small quarters on separate floors. Perhaps more important is that its lackluster test scores, some parents fear, could force the school to drop its progressive emphasis. That would be a shame, say two parents who moved back to New York City from London, England, specifically so their kindergarten-age kids could attend East Village. \"I picked this school because I want them to love learning, I want them to grow into strong, caring people, I want them to take a responsible role in a democratic society, and I want them to understand and respect people who are different from themselves,\" Linda Levy, the children\'s mother, wrote to Chancellor Joel Klein, \"These are not things that can be measured by a standardized test.\" <em>(</em>For a more detailed profile, see <a href=\"http://www.insideschools.org/home/bookstore/\">New York City\'s Best Public Elementary Schools</a>. <em>Judy Baum, January 2003)</em></p>
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: extracting the Month and yer from table and add it to new ta

Post by Benjamin »

Forum Rules wrote: 11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.

Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.
As for your question, I'm not sure what the best approach would be right off the bat. Perhaps a complex regex expression or series of expressions. Here's a good start.

Code: Select all

 
preg_match_all('#(December|November|October|September|August|July|June|May|April|March|February|January),{0,1}\s{1,3}(\d{4})#i', $data, $matches);
print_r($matches);
 
ihabgr
Forum Newbie
Posts: 13
Joined: Fri Jul 11, 2008 11:26 am

Re: extracting the Month and yer from table and add it to new ta

Post by ihabgr »

if i want you to do the fowllowing for me
tke the date from the text to from the entries in the datbase and add to sperate filed how much you charge me "this for non profit orgnization" we help the kids to have equal eduqation
thank you
Post Reply