Click here to Skip to main content
15,897,891 members
Home / Discussions / Database
   

Database

 
SuggestionRe: OLAP database missing... Pin
Richard MacCutchan13-Nov-13 0:37
mveRichard MacCutchan13-Nov-13 0:37 
AnswerRe: OLAP database missing... Pin
GuyThiebaut13-Nov-13 2:57
professionalGuyThiebaut13-Nov-13 2:57 
QuestionMariaDB and c# Pin
Septimus Hedgehog12-Nov-13 3:59
Septimus Hedgehog12-Nov-13 3:59 
AnswerRe: MariaDB and c# Pin
Simon_Whale13-Nov-13 3:40
Simon_Whale13-Nov-13 3:40 
GeneralRe: MariaDB and c# Pin
Septimus Hedgehog13-Nov-13 7:29
Septimus Hedgehog13-Nov-13 7:29 
AnswerTested successfully. Pin
Septimus Hedgehog14-Nov-13 1:12
Septimus Hedgehog14-Nov-13 1:12 
QuestionConcat NULL yields NULL inside a Function Pin
Fabricio Dos Santos Antunes12-Nov-13 0:36
Fabricio Dos Santos Antunes12-Nov-13 0:36 
AnswerRe: Concat NULL yields NULL inside a Function Pin
Simon_Whale12-Nov-13 1:01
Simon_Whale12-Nov-13 1:01 
AnswerRe: Concat NULL yields NULL inside a Function Pin
Mycroft Holmes12-Nov-13 1:57
professionalMycroft Holmes12-Nov-13 1:57 
SuggestionRe: Concat NULL yields NULL inside a Function Pin
Richard Deeming12-Nov-13 3:08
mveRichard Deeming12-Nov-13 3:08 
GeneralRe: Concat NULL yields NULL inside a Function Pin
Fabricio Dos Santos Antunes13-Nov-13 6:26
Fabricio Dos Santos Antunes13-Nov-13 6:26 
QuestionAccess 2003 tables to link sqlexpress 2005 but i had not seen table .DBO ? Pin
Member 245846711-Nov-13 17:02
Member 245846711-Nov-13 17:02 
AnswerRe: Access 2003 tables to link sqlexpress 2005 but i had not seen table .DBO ? Pin
Eddy Vluggen14-Nov-13 6:57
professionalEddy Vluggen14-Nov-13 6:57 
Questiondatabase schema Pin
Member 1039287510-Nov-13 19:09
Member 1039287510-Nov-13 19:09 
GeneralRe: database schema Pin
Kornfeld Eliyahu Peter10-Nov-13 19:35
professionalKornfeld Eliyahu Peter10-Nov-13 19:35 
AnswerRe: database schema Pin
Mycroft Holmes10-Nov-13 21:29
professionalMycroft Holmes10-Nov-13 21:29 
AnswerRe: database schema Pin
jschell11-Nov-13 8:16
jschell11-Nov-13 8:16 
GeneralRe: database schema Pin
PIEBALDconsult11-Nov-13 17:54
mvePIEBALDconsult11-Nov-13 17:54 
AnswerRe: database schema Pin
Shameel12-Nov-13 3:17
professionalShameel12-Nov-13 3:17 
QuestionConditional query (sql) Pin
leone10-Nov-13 7:11
leone10-Nov-13 7:11 
AnswerRe: Conditional query (sql) Pin
Mycroft Holmes10-Nov-13 12:22
professionalMycroft Holmes10-Nov-13 12:22 
QuestionA mixture of PHP PDO and fabricating a query replacing SELECT SQL CALC FOUND ROWS Pin
jkirkerx7-Nov-13 10:12
professionaljkirkerx7-Nov-13 10:12 
I will try my best to describe this, it's the same PHP project from my post below, my next biggest hurdle to jump here.
I'm trying to solve this through SQL, without having to change much of the the PHP Code

I have this line of code, in which it takes a query from the calling class which passes it to this class that contains the line below. Sort of crazy or genius.
$lc_query = '(SELECT SQL_CALC_FOUND_ROWS ' . substr($pc_query, 6) . ') LIMIT ' . (($ln_page - 1) * $ln_pagesize) . ', ' . $ln_pagesize; // This wipes out the parameters!

So I changed the code from using the old mysql handle to the new PDO. I could not find a way to pass an array of parameter tokens to this class, because the token count could be any number of them. The classic trying to bind parameters in a loop failure.

Original way:
Class 1, generate the query, and passes it to class 2
Class 2, calculate page count, then uses the line above to wrap the passed in query and transmit it.

So I did this:
class 1: generates the dynamic query, makes a PDO instance, bind parameters, pass PDO to class 2
class 2: receives the PDO handle, and executes.

So far so good, it works good, stable, but I need the calculations in the Class 2 for page indexing.

I can't figure out how to reintegrate the above statement in class 2 where the page numbers are generated.
I was hoping I would be able to extract the query out of the PDO object, and reconstruct it. Plus I don't think the line above works in PDO.

If you have any thoughts, comments or past experience with this, I'd appreciate it!

Class 1
//PDOClass: Make a Default Connection
$cmd_sp = $PDOClass->QUERY($lc_query);
if ($b_mfgName) $cmd_sp->bindParam(':mfgName', $lc_mfg, PDO::PARAM_STR);                
if ($b_deptID) $cmd_sp->bindParam(':deptID', $pn_dept_id, PDO::PARAM_INT);
if ($b_partnerID) $cmd_sp->bindParam(':partnerID', $go_sitedict['partner_id'], PDO::PARAM_INT);

$SPClass = new SPClass(
  $cmd_sp, 
  $cmd_sp_mfg, 
  FALSE, 
  '', 
  $ll_debug
);

Class 2:
// So how to we wrap this around the query that we already sent to PDO?
$lc_query = '(SELECT SQL_CALC_FOUND_ROWS ' . substr($pc_query, 6) . ') LIMIT ' . (($ln_page - 1) * $ln_pagesize) . ', ' . $ln_pagesize; // This wipes out the parameters!
            
try {           
     // PDOClass: Execute the PDO that was passed in
     $cmd_showProduct->execute();
                
}

QuestionSQL Query, Unknown column 'p.prod_id' in 'on clause' Pin
jkirkerx7-Nov-13 6:19
professionaljkirkerx7-Nov-13 6:19 
AnswerRe: SQL Query, Unknown column 'p.prod_id' in 'on clause' Pin
Tim Carmichael7-Nov-13 7:47
Tim Carmichael7-Nov-13 7:47 
GeneralRe: SQL Query, Unknown column 'p.prod_id' in 'on clause' Pin
jkirkerx7-Nov-13 8:33
professionaljkirkerx7-Nov-13 8:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.