darlingss Posted July 22, 2016 Posted July 22, 2016 Help me please!! I have a database in another host in where i am SUPER USER, i dont use heliohost database because i cant execute EVENTS MYSQL and then i decided use my database in another host where i can EXECUTE EVENTS THE QUESTION!! When i am trying connect to my external database I JUST GET INTERNAR SERVER ERROR 500, the dates of conecction are correct i dont undertand that message !! Please help me
wolstech Posted July 22, 2016 Posted July 22, 2016 You should just be able to just use the other database server's host name instead of localhost. Be aware though, it does have to be running on port 3306 on the remote server since we block most nonstandard ports.
darlingss Posted July 22, 2016 Author Posted July 22, 2016 You should just be able to just use the other database server's host name instead of localhost. Be aware though, it does have to be running on port 3306 on the remote server since we block most nonstandard ports.Are correct, I use port 3306 and the IP/nameHost external database, but not fucntion INTERNARL SERVER ERROR 500
Krydos Posted July 22, 2016 Posted July 22, 2016 $mysqli = new mysqli($servername, $username , $password, "HotelEscuela",33066); ^^^^^ That doesn't look like port 3306. You have an extra digit in there.
darlingss Posted July 26, 2016 Author Posted July 26, 2016 Sorry my acount has been suspended ... why?
wolstech Posted July 26, 2016 Posted July 26, 2016 I assume your account name is darlings. It was for high load. Try now.
darlingss Posted July 26, 2016 Author Posted July 26, 2016 Thank you so much!! and sorry i cant connect to my another external datababase and i use your database but i need to RUN EVENTS, HOW? can i run events?
wolstech Posted July 26, 2016 Posted July 26, 2016 I'm assuming you've fixed the port number issue Krydos pointed out above? As for events, I'm not sure we support it. I'll escalate this since it still doesn't work and I don't know about the SQL events.
Krydos Posted July 26, 2016 Posted July 26, 2016 Why not just use cron jobs to run your scheduled mysql events?
darlingss Posted July 26, 2016 Author Posted July 26, 2016 I need to make this... but the option run event is block because im not super user ver evento activoshow variables like '%event%'; activar eventosset GLOBAL event_scheduler=ON; EVENTO CREATE EVENT act_reservacionON hotelescuela EVERY 1 DAY STARTS ‘2016-07-11 12:00:00’ + interval 1 dayDO UPDATE habitaciones INNER JOIN DETALLES ON habitaciones.id = detalles.idhabitacion INNER JOIN RESERVACIONES ON reservaciones.id = detalles.idreservacionSET habitacione.status = 0 WHERE reservaciones.fechaPart = now();
wolstech Posted July 26, 2016 Posted July 26, 2016 You can easily do that with a PHP script and a cron job. That's the way I'd recommend it be done. Something like this (not tested, may have syntax errors). Run it from a once per day cron job. <?php $connection = mysqli_connect("localhost","databasename","user","password"); $update = mysqli_query($connection,"UPDATE habitaciones INNER JOIN DETALLES ON habitaciones.id = detalles.idhabitacion INNER JOIN RESERVACIONES ON reservaciones.id = detalles.idreservacion SET habitacione.status = 0 WHERE reservaciones.fechaPart = '".time()."'"); ?>
Recommended Posts