# INSERT INTO

**URL:** <https://www.phphelp.com/t/insert-into/13612>\
**Category:** MySQL database\
**Created:** [June 16, 2011, 1:51pm UTC](https://www.phphelp.com/t/insert-into/13612 "2011-06-16T13:51:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jakleit](https://www.phphelp.com/letter_avatar_proxy/v4/letter/j/8edcca/32.png) [@jakleit](https://www.phphelp.com/u/jakleit)\
**Post date:** [June 16, 2011, 1:51pm UTC](https://www.phphelp.com/t/insert-into/13612/1 "2011-06-16T13:51:20Z")

</div>

anyone know why this does not work?

[php]mysql\_query(“INSERT INTO `machine` (EquipFile ID) VALUES (’”.$equipnum."’)");[/php]

---

<div class="post-metadata">

**Author:** ![jakleit](https://www.phphelp.com/letter_avatar_proxy/v4/letter/j/8edcca/32.png) [@jakleit](https://www.phphelp.com/u/jakleit)\
**Post date:** [June 16, 2011, 1:55pm UTC](https://www.phphelp.com/t/insert-into/13612/2 "2011-06-16T13:55:16Z")

</div>

Let this be a simple lesson. You cannot have spaces in mysql column heading while using this function.

---

<div class="post-metadata">

**Author:** ![steamindaemon](https://www.phphelp.com/letter_avatar_proxy/v4/letter/s/e68b1a/32.png) [@steamindaemon](https://www.phphelp.com/u/steamindaemon)\
**Post date:** [June 17, 2011, 9:38pm UTC](https://www.phphelp.com/t/insert-into/13612/3 "2011-06-17T21:38:40Z")

</div>

Why not enclose the column name in backticks?

[php]mysql\_query(“INSERT INTO `machine` (`EquipFile ID`) VALUES (’”.$equipnum."’)");[/php]

Using spaces in column names is generally a bad idea, but this may be a suitable workaround.

---

<div class="post-metadata">

**Author:** ![jakleit](https://www.phphelp.com/letter_avatar_proxy/v4/letter/j/8edcca/32.png) [@jakleit](https://www.phphelp.com/u/jakleit)\
**Post date:** [June 20, 2011, 2:28pm UTC](https://www.phphelp.com/t/insert-into/13612/4 "2011-06-20T14:28:28Z")

</div>

Exactly what is the difference between `machine` and machine? What do the back quotation things do exactly? The use of them seems to never be consistant. It seems sometimes you need them and sometimes you dont.
