Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted

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

Posted
$mysqli = new mysqli($servername, $username , $password, "HotelEscuela",33066);
^^^^^
That doesn't look like port 3306. You have an extra digit in there.
Posted

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?

Posted

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.

Posted

I need to make this... but the option run event is block because im not super user

 

ver evento activo

show variables like '%event%';

 

activar eventos

set GLOBAL event_scheduler=ON;

 

EVENTO

 

CREATE EVENT act_reservacion

ON hotelescuela EVERY 1 DAY STARTS ‘2016-07-11 12:00:00’ + interval 1 day

DO

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 = now();

Posted

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()."'");
?>
Guest
This topic is now closed to further replies.
×
×
  • Create New...