This commit is contained in:
omkieit 2024-09-22 20:55:05 +05:30
parent 8b3aa8c793
commit 01b632ed21
1 changed files with 3 additions and 8 deletions

View File

@ -1,5 +1,5 @@
import mysql from "mysql2"; import mysql from "mysql2";
// import pool from "../db/db.js"; import pool from "../db/db.js";
const db = mysql.createConnection({ const db = mysql.createConnection({
host: "db-mysql-nyc1-99306-do-user-12431193-0.b.db.ondigitalocean.com", 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 // Controller function to search for MYSQL properties by house_id
export const PropertiesMysqlView = async (req, res) => { export const PropertiesMysqlView = async (req, res) => {
const { house_id } = req.params; const { house_id } = req.params;
console.log("hu", house_id); // console.log("hu", house_id);
try { try {
const query = ` const query = `SELECT * FROM home_information WHERE house_id = ?`;
SELECT *
FROM home_information
WHERE house_id = ?
`;
const [rows] = await pool.query(query, [house_id]); const [rows] = await pool.query(query, [house_id]);
if (rows.length > 0) { if (rows.length > 0) {