View Single Post
06-01-2012, 09:20 AM
#2
stephan2307 is offline stephan2307
Status: I'm new around here
Join date: Jun 2012
Location: UK
Expertise: php, mysql, js, jquery
Software: PHPDesigner, Chrome
 
Posts: 10
iTrader: 0 / 0%
 

stephan2307 is on a distinguished road

  Old

I like it.

but I think you could make it a little bit easier to use.

PHP Code:
$sql 'SELECT *
        FROM messages m
        WHERE m.message_id = :message_id
        AND m.temperature = :temperature'
;
 
$params = array(
        
':message_id' => '48',
        
':temperature' => '23'
    
);
 
$db->query($sql$params); 
you could update your code so that it would allow sql like this


PHP Code:
$sql 'SELECT *
        FROM messages m
        WHERE m.message_id = 48
        AND m.temperature = 23'
;

$db->query($sql); 
wouldn't be that difficult and make more sense when using the class.