prepare Statement (" SELECT ▁* ▁FROM ▁products ▁WHERE ▁name ▁= ▁? ")) ▁{ ▁▁▁▁▁▁▁▁ ▁st mt . set String ( 1 , ▁" sh o es "); ▁▁▁▁▁▁▁▁ ▁Result Set ▁rs ▁= ▁st mt . execute Query (); ▁▁▁▁▁▁▁▁ ▁rs . next (); ▁▁▁▁▁▁▁▁ ▁System . out . println ( rs . get Int ( 2 )); ▁▁▁▁▁▁ ▁} ▁▁▁▁ ▁} ▁▁ ▁} ▁} ▁ ▁Java ▁P rep ared Statement ▁provides ▁" set ters " ▁( set Int ( int ), ▁set String ( String ), ▁set Double ( double ), ▁etc .) ▁for ▁all ▁major ▁built - in ▁data ▁types . ▁ ▁PHP ▁PDO ▁ ▁This ▁example ▁uses ▁PHP ▁and ▁PDO : ▁ ▁<? php ▁ ▁try ▁{ ▁▁▁▁ ▁// ▁Connect ▁to ▁a ▁database ▁named ▁" mysql ", ▁with ▁the ▁password ▁" root " ▁▁▁▁ ▁$ connection ▁= ▁new ▁PDO (' mysql : db name = mysql ', ▁' root '); ▁▁▁▁▁ ▁// ▁Exec ute ▁a ▁request ▁on ▁the ▁connection , ▁which ▁will ▁create ▁▁▁▁ ▁// ▁a ▁table ▁" products " ▁with ▁two ▁columns , ▁" name " ▁and ▁" price " ▁▁▁▁ ▁$ connection -> exec (' CREATE ▁TABLE ▁IF ▁NOT ▁EXISTS ▁products ▁( name ▁VARCHAR ( 4 0 ), ▁price ▁INT ) '); ▁▁▁▁▁ ▁// ▁P rep are ▁a ▁query ▁to ▁insert ▁multiple ▁products ▁into ▁the ▁table ▁▁▁▁ ▁$ statement ▁= ▁$ connection -> prepare (' INSERT ▁INTO ▁products ▁VALUES ▁( ?, ▁? ) '); ▁▁▁▁ ▁$ products ▁ ▁= ▁[ ▁▁▁▁▁▁▁▁ ▁[' bi ke ', ▁ 1 0 9