done
This commit is contained in:
parent
8b3aa8c793
commit
01b632ed21
|
@ -1,5 +1,5 @@
|
|||
import mysql from "mysql2";
|
||||
// import pool from "../db/db.js";
|
||||
import pool from "../db/db.js";
|
||||
|
||||
const db = mysql.createConnection({
|
||||
host: "db-mysql-nyc1-99306-do-user-12431193-0.b.db.ondigitalocean.com",
|
||||
|
@ -102,15 +102,10 @@ export const searchMySQL = (req, res) => {
|
|||
// Controller function to search for MYSQL properties by house_id
|
||||
export const PropertiesMysqlView = async (req, res) => {
|
||||
const { house_id } = req.params;
|
||||
console.log("hu", house_id);
|
||||
// console.log("hu", house_id);
|
||||
|
||||
try {
|
||||
const query = `
|
||||
SELECT *
|
||||
FROM home_information
|
||||
WHERE house_id = ?
|
||||
`;
|
||||
|
||||
const query = `SELECT * FROM home_information WHERE house_id = ?`;
|
||||
const [rows] = await pool.query(query, [house_id]);
|
||||
|
||||
if (rows.length > 0) {
|
||||
|
|
Loading…
Reference in New Issue