I have problems linking my Project to my database. I want to select stuff from a vertica database into my project. In normal PHP it works, but the same code does not work in Laravel:
# Connect to the Database
$dsn = "VerticaDSN";
$conn = odbc_connect($dsn,'','') or die ("<br/>CONNECTION ERROR");
echo "<p>Connected with DSN: $dsn</p>";
# Get the data from the table and display it
$sql = "SELECT column FROM table";
if($result = errortrap_odbc($conn, $sql))
{
echo "<pre>";
while($row = odbc_fetch_array($result) )
{
echo "hi";
print_r($row);
}
echo "</pre>";
}
Is there a method that this code works inside my Laravel Controller?