Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Utorok, 13. október 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Only Pull Record Specific Data

phpMyEdit Features     Only Pull Record Specific Data
Odoslať novú tému   Odpovedať na tému    
 
petermourra     Založený: 26.05.2009   Príspevky: 1  
Príspevok Zaslal: 2009-05-27 14:39
Návrat hore  Odpovedať s citátom     

Hello Everyone, I love this script but i need to do something that has me a little stuck.

How can I only show specific records without using the query button.

For example i would only like to show all records with Category !D 1001

$opts['filters'] = "column1 like '%11%' AND column2<17";
$opts['filters'] = "section_id = 9";
$opts['filters'] = "PMEtable0.sessions_count > 200";
$opts['filters'] = "Categoria=1001";

--------------------------------------------------
and


$opts['fdd']['Categoria'] = array(
'name' => 'CatID',
'select' => 'T',
'required' => true,
'sort' => true,
);


These are still showing me all data. Please assist

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2009-05-29 04:45
Návrat hore  Odpovedať s citátom     

Maybe your problem is an issue with quoting, try the following:
Kód:
$opts['filters'] = "PMEtable0.Categoria = '1001'";


 
adssaccounting     Založený: 04.02.2010   Príspevky: 5  
Príspevok Zaslal: 2010-02-06 23:31
Návrat hore  Odpovedať s citátom     

doug Napísal:
Maybe your problem is an issue with quoting, try the following:
Kód:
$opts['filters'] = "PMEtable0.Categoria = '1001'";


I would like to only show current date entries. The date format is currently mm/dd/yy. So instead of '1001' what would the syntax be for current date?

Thanks in advance for your help.

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2010-02-07 05:51
Návrat hore  Odpovedať s citátom     

MySQL date format is yyyy-mm-dd thus to display records dated today:

Kód:
$opts['filters'] = "PMEtable0.my_date_field = '".date('Y-m-d')."'";


 
adssaccounting     Založený: 04.02.2010   Príspevky: 5  
Príspevok Zaslal: 2010-02-07 15:00
Návrat hore  Odpovedať s citátom     

Thanks, but it still shows all the dates.

The database logs the date like this:

2010-02-05 12:50:28

and what i'm looking to do is to pull only data that is posted today.

This what I have:

$opts['filters'] = "column1 like '%11%' AND column2<17";
$opts['filters'] = "section_id = 9";
$opts['filters'] = "PMEtable0.sessions_count > 200";
$opts['filters'] = "PMEtable0.added = '".date('y-m-d')."'";

and

$opts['fdd']['added'] = array(
'name' => 'Added',
'select' => 'T',
'required' => true,
'maxlen' => 1023,
'sort' => true
);

Please advise what i'm doing wrong.

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2010-02-07 15:08
Návrat hore  Odpovedať s citátom     

What is the field definition? DATE, TIMESTAMP, or DATETIME

If TIMESTAMP, what is the version of MySQL?

 
adssaccounting     Založený: 04.02.2010   Príspevky: 5  
Príspevok Zaslal: 2010-02-07 15:36
Návrat hore  Odpovedať s citátom     

it is datetime

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2010-02-07 15:42
Návrat hore  Odpovedať s citátom     

Since you've used DATETIME, your filter will need to have two parts, filtering a range of records, basically the beginning and end of the time portion, the start 00:00:00 and the end 23:59:59

Searching the forum for DATETIME might turn up some examples.

 
adssaccounting     Založený: 04.02.2010   Príspevky: 5  
Príspevok Zaslal: 2010-02-07 16:02
Návrat hore  Odpovedať s citátom     

Ok I changed it to DATE, and still does not filter. What should I change it to?

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2010-02-07 16:10
Návrat hore  Odpovedať s citátom     

Make sure you have date('Y-m-d') and not date('y-m-d')

http://us2.php.net/manual/en/function.date.php

Otherwise, too many variables involved to know what the problem is. If you post the schema as exported by phpMyAdmin it would be helpful.

 
adssaccounting     Založený: 04.02.2010   Príspevky: 5  
Príspevok Zaslal: 2010-02-07 16:21
Návrat hore  Odpovedať s citátom     

Operating system: Linux (Linux harriet.site5.com 2.6.27-grsec4 #1 SMP Tue Nov 10 22:51:54 GMT 2009 x86_64)
MySQL-Version: 5.0.85-community-log
PHP-Version: 5.2.8 Memory: 32.00 MB Max execution time: 30 Seconds

------------------------------------------
This is what I have:


$opts['filters'] = "column1 like '%11%' AND column2<17";
$opts['filters'] = "section_id = 9";
$opts['filters'] = "PMEtable0.sessions_count > 200";
$opts['filters'] = "PMEtable0.added = '".date('Y-m-d')."'";

and

$opts['fdd']['added'] = array(
'name' => 'Added',
'select' => 'T',
'required' => true,
'maxlen' => 1023,
'sort' => true
);

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov