▁DB I ; ▁ ▁my ▁($ db _ name , ▁$ db _ user , ▁$ db _ password ) ▁= ▁(' my _ database ', ▁' mo i ', ▁' Pass w 0 r D '); ▁my ▁$ db h ▁= ▁DB I -> connect (" DB I : mysql : database =$ db _ name ", ▁$ db _ user , ▁$ db _ password , ▁▁▁▁ ▁{ ▁Ra ise Error ▁=> ▁ 1 , ▁Auto Com mit ▁=> ▁ 1 }) ▁▁▁▁ ▁or ▁die ▁" ERROR ▁( main : DB I -> connect ) ▁while ▁connecting ▁to ▁database ▁$ db _ name : ▁" ▁. ▁▁▁▁▁▁▁▁ ▁$ DB I :: err str ▁. ▁"\ n "; ▁ ▁$ db h -> do (' CREATE ▁TABLE ▁IF ▁NOT ▁EXISTS ▁products ▁( name ▁VARCHAR ( 4 0 ), ▁price ▁INT ) '); ▁ ▁my ▁$ st h ▁= ▁$ db h -> prepare (' INSERT ▁INTO ▁products ▁VALUES ▁( ?, ▁? ) '); ▁$ st h -> execute (@ $_ ) ▁foreach ▁[' bi ke ', ▁ 1 0 9 0 0 ], ▁[' sh o es ', ▁ 7 4 0 0 ], ▁[' phone ', ▁ 2 9 5 0 0 ]; ▁ ▁$ st h ▁= ▁$ db h -> prepare (" SELECT ▁* ▁FROM ▁products ▁WHERE ▁name ▁= ▁? "); ▁$ st h -> execute (' sh o es '); ▁print ▁"$ $_ [ 1 ]\ n " ▁foreach ▁$ st h -> fetch row _ array ref