0

I need to update in my table all key start by 'example_', in databse i have

- id
- example_1
- example_2
- ...
- date

php

$sql = "UPDATE table SET example_*='0'";
$sql = $db->prepare($sql);
$sql->execute();

But this solution not work. Thanks you

Joe e
  • 33
  • 2
  • looks like a bad design to have column names like that - which is why you cant use wild cards directly on them –  Jul 07 '15 at 01:05
  • What is good design for multiple value ? Json ? But i need json_decode, edit and json_encode for each update ? – Joe e Jul 07 '15 at 01:20
  • hard to answer with out exact details but you probably want a new table with `id | example` then query with joins –  Jul 07 '15 at 01:22

0 Answers0