I am trying to fetch values from a mysql query using PDO...it works with one column but I need to return 2 columns from the query. Below is the piece of code I have made...
try { $conn = new PDO('mysql:host=localhost;dbname=****', 'root', '****'>setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch(PDOException $e) { echo 'ERROR: ' . $e->getMessage(); } $sth = $conn->prepare("select distinct prod_url,ean from tab_nl where ean in (select ean1 from test_sku where sku='$sku') and prod_url like '%prijzen%'"); $sth->execute(); $urlsku = $sth->fetchAll(PDO::FETCH_COLUMN, 0); $urlean = $sth->fetchAll(PDO::FETCH_COLUMN, 1); echo $sku; echo $urlsku; echo $urlean; It returns me some array values...which I really can't figure out. Can anyone please help me with this.