Hello.

There is a table members, in it the column fullName. When inserting PDO swears that there is no such field. Change the name to fullname everything is fine.

$member = ["fullName" => "Василий Пупкин"]; _DB::i()->insRow("INSERT INTO members (fullName) VALUES (:fullName)",$member); 

Is it possible to get around this nuance without renaming the database?

  • Usually in the database, the compound name of the tables and columns is written through the underscore, for example object_id or fill_factor ... i.e. In your case, full_name ...... although this particular field is usually written together, i.e. fullname - Alexey Shimansky
  • Yes, I understand that, but the understanding came late. The project is attached to the keys of the forms in the templates. Began migration to pdo and voila) - mrFlyer
  • Oh .. for me it's easier to spend a little time and rename in templates and do everything like that)) But. in theory you can use setAttribute and specifically setAttribute( PDO::ATTR_CASE, PDO::CASE_NATURAL ) ....... as an example at stackoverflow.com/a/12587701/6104996 ..... if of course you have the opportunity Drivers tweak something, otherwise you will have no choice as to fix the templates - Alexey Shimansky
  • With the attributes played, but it is everywhere to prescribe AS. Okay, let's go standardize. =)) - mrFlyer

0