How can I fake sql data while preserving statements without commenting my server-side code?

Posted by Fedor on Stack Overflow See other posts from Stack Overflow or by Fedor
Published on 2010-04-30T19:46:51Z Indexed on 2010/04/30 19:57 UTC
Read the original article Hit count: 159

Filed under:
|
|
|

I have to use hardcoded values for certain fields because at this moment we don't have access to the real data.

When we do get access, I don't want to go through a lot of work uncommenting.

Is it possible to keep this statement the way it is, except use '25' as the alias for ratecode?

   IF(special.ratecode IS NULL, br.ratecode, special.ratecode) AS ratecode,

I have about 8 or so IF statements similar to this and I'm just too lazy ( even with vim ) to re-append while commenting out each if statement line by line. I would have to do this:

$sql = 'SELECT u.*,';

// IF ( special.ratecode IS NULL, br.ratecode, special.ratecode) AS ratecode
$sql.= '25 AS ratecode';

© Stack Overflow or respective owner

Related posts about mysql

Related posts about faking-data