How to change this to associative array

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
Chrisj
New php-forum User
New php-forum User
Posts: 18
Joined: Thu Oct 07, 2004 10:04 am

Sun Aug 05, 2018 12:37 pm

Can you help me change this to an associative array?

Code: Select all

$query=$db->prepare("SELECT * FROM users WHERE id = :val1 ");
$query->bindValue(':val1', $a, PDO::PARAM_STR);
$query->execute();
$data=$query->fetch();

User avatar
benanamen
New php-forum User
New php-forum User
Posts: 55
Joined: Mon Oct 16, 2017 1:06 pm

Mon Aug 06, 2018 10:01 am

What is the Real problem you are trying to solve? I dont mean your attempt at solving it.
The XY Problem
The XY problem is asking about your attempted solution (X) rather than your actual problem (Y). This leads to enormous amounts of wasted time and energy, both on the part of people asking for help, and on the part of those providing help.

Chrisj
New php-forum User
New php-forum User
Posts: 18
Joined: Thu Oct 07, 2004 10:04 am

Mon Aug 06, 2018 2:17 pm

I've resolved it, thanks

Post Reply