Category : mysql

I have a problem connecting Laravel to a MySQL database. The project is not inside a docker/homestead virtual box, it’s directly on my PC running Windows 10 (sadly). The .env file looks like that: DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=simac DB_USERNAME=root DB_PASSWORD= When I try to run the migrations with artisan migrate I get the following: simacvendorlaravelframeworksrcIlluminateDatabaseConnectorsConnector.php:70 ..

Read more

Here’s my code: $terminosBuscados = ‘Vender la porteria’ $x = $conectarDB->prepare(" SELECT DISTINCT titulo, FROM_UNIXTIME(fecha, ‘%d-%m-%Y’) AS fecha, cuerpo, tipoContenido, autor FROM searchIndex WHERE match(titulo) AGAINST (‘ ? ‘ IN BOOLEAN MODE) ORDER BY contenidoID DESC "); $x->bindParam(1, $terminosBuscados); $x->execute(); $y = $x->fetchAll(PDO::FETCH_ASSOC); This is showing no results at all ($y returns null), when trying ..

Read more

<?php if(isset($_POST[‘Register’])) { $Username = $_POST[‘Username’]; $Name = $_POST[‘Name’]; $password = $_POST[‘password’]; $Email = $_POST[‘Email’]; } //Database Connection $servername = "localhost"; $dbusername = "root"; $dbpassword = "[email protected]"; $dbname = "railways"; $conn = new mysqli($servername,$dbusername,$dbpassword,$dbname); if($conn->connect_error) { die(‘Connection failed : ‘.$conn->connect_error); } else { $stmt = $conn->prepare("INSERT INTO register(Username,Name,Password,Email) values(?,?,?,?)"); $stmt->bind_param("ssss",$Username,$Name,$password,$Email); $stmt->execute(); echo "<h2>Registration Done Succesfully…<h2>"; ..

Read more

Table to itinerary details table. How do you go about creating the trigger? CREATE TABLE itinerary_details( itinerary_id INT NOT NULL, uuid INT NOT NULL, itinerary_date VARCHAR(250) NOT NULL, START_TIME TIME NOT NULL, END_TIME TIME NOT NULL, CONSTRAINT PK_itineraries PRIMARY KEY (START_TIME,itinerary_id,itinerary_date), CONSTRAINT FK_itinerary_details FOREIGN KEY (itinerary_id) REFERENCES itineraries(itinerary_id) ); Source: ..

Read more