linwiz / Raspberry-Pi-Web-GPIO

PHP script to control Raspberry PI GPIO pins from the web
GNU General Public License v3.0
4 stars 1 forks source link

Improved performance by reducing mysql querys #28

Closed linwiz closed 9 years ago

Paku- commented 9 years ago

Have you tested this ?? You may remove echos as well

linwiz commented 9 years ago

It is working for my rev2 Pi

Paku- commented 9 years ago
Importing docs/gpio.sql into database user@localhost/gpio
ERROR 1062 (23000) at line 52: Duplicate entry '1' for key 'PRIMARY'

we lost my gpio.sql somewhere ...

Paku- commented 9 years ago

yes gpio.sql is not mine,

there is no DROP commands., nor KEY pinNumber (pinNumberBCM)

for rev3 tbl

linwiz commented 9 years ago

This was your commit

Unfortunately as you can see pinNumberBCM cannot be unique because of the 'X' values that are assigned for non GPIO pins.

I removed the drop command because it will erase someones pin descriptions if they choose to customize them. I added them in the past originally, but now I see that this was a mistake.

Paku- commented 9 years ago

So, as I remember I left the non uniq index there ... On drop: so script is not able to update the database ... We need a solution for one press db update ...

linwiz commented 9 years ago

It is possible, the drupal content management system allows for automatic database updates. I don't know the technical parts of how it works though.

Paku- commented 9 years ago

So maybe you can add a question if some one wants to update the base.

One more: we can remove sleep 0.2 now as there is only one select.