Sunday, 15 February 2015

database - Update a column that is similar to all tables - MYSQL -



database - Update a column that is similar to all tables - MYSQL -

i have question::

a point have database 1000 tables, several of them have lat lng field , user id ( every table has lat lng has id field ) has changed location.

now have update tables haven'tt designed database ( i'm new @ job , boss throwed hot bowl me ) don't know start.

is there way alter info on every tables have latlng field , share id number ?

for example: if id = 1024 , table has latlng cell, update latlng cell new value.

thanks in advance.

so, had views, i'll post solution :

in order update tables share id number ( instance, have 1 table each service , id , address of every client bought @ point, 1 client had location changed ), in order update made php script goes this:

<?php // connecting ! $con =mysqli_connect("localhost","my_username","my_password","database"); // convert code $showtables = mysqli_query($con,"show tables"); while ($row = mysqli_fetch_array($showtables)) { foreach ($row $key => $table) { mysqli_query($con,"update `". $table . "` set `addres`='new_address' `id`= '27' "); echo "update `". $table . "` set `address`='new_address' `id`= '27' "; // testing purposes - can delete this! } } ?>

this it, made me want break pc @ point when see it, simple!

best regards.

mysql database mysqli

No comments:

Post a Comment