I'm attempting to showcase a list of users who reside in the same area as the currently logged-in user. In simpler terms, if the logged-in user has a postcode starting with 'm3 4', then any other user(s) with the same prefix will be displayed. Here's an e ...
I have a scenario where I need to add multiple users in my database by uploading a CSV file. The CSV file contains three columns: first_name, last_name, email. How can I achieve this using my existing user model and controller? Model.js const User = sequ ...
If you're like me and struggling to figure out how to add a session variable (username) to a database using ajax, I've been there. My limited knowledge of jQuery and JavaScript made it quite the challenge. The dynamic table I'm working with ...
Displayed below is the code snippet from my app's Cart.php use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Cart extends Model { use SoftDeletes; protected $table = &apo ...
I am facing a challenge and need help solving it. I have a project that involves interacting with a database, where I created a CRUD HTML table for data manipulation. There are 15 tables in the relative database, and I need to insert, delete, and edit reco ...
Here is a function that I have: public function getReward($formattedArray, $key){ $id = $formattedArray[$key][0]; //dd($id); //Returns 1 $reward = Item::find($id); return $reward; } The problem arises when executing this part of the code ...
I am exploring the option to store the user id in the MySQL Database's sessions table using express-mysql-session. Initially, I set the user id in the middleware as shown below: import "dotenv/config"; import express from "express" ...
Recently, I've been working on a project where I'm trying to incorporate Visual Analytics. I'm looking to create a graph from a UI that's part of an HTML form. Below is the code snippet from my HTML page: <!DOCTYPE html> <html& ...
https://i.stack.imgur.com/GQAMy.jpg I am facing a challenge with joining two tables, table1 and table2, in MySQL. I need assistance in creating the resultant table as shown in the attached picture. Your help in solving this issue would be greatly appreci ...
Having recently delved into the world of Node.js, I came across a helpful tutorial on this website that taught me how to create REST APIs using Node.js. Now I'm trying to figure out how to upload an image file using Node.js and save it in a MySQL table. ...
Is there a way to export human resource applications stored in my MySQL table as an Excel file? function exportExcel($filename='ExportExcel',$columns=array(),$data=array(),$replaceDotCol=array()){ global $connect; header('Content-Encoding: UTF-8'); ...
I've encountered a problem with AJAX that involves parsing a JSON Array from a webservice I am developing. The front-end of my project uses a simple combination of ajax and jQuery to showcase the results retrieved from the webservice. Despite being certai ...
As a newcomer to these technologies, I've been struggling all day with what I expected to be a simple task. My goal is to pass a parameter from a JS function to my PHP code using AJAX and then insert that parameter into my database. Here's the JS function ...
Having some trouble identifying the issue here. It seems quite simple, but I'll highlight it here anyway. On a basic website, I have a form for user registration where I'm using AJAX to send data to register.php. The form and AJAX code are as follows: ...
I have successfully implemented a Ticketing System using PHP and MySQL database. The view tickets page displays each ticket from the database along with its priority level, which can be Low, Normal or High. Currently, the priority value pulled from the d ...
I have developed two unique web pages. One is called BookTicket which contains a form with two buttons. The first button submits the form and stores the information in a database, while the second button navigates to a payment page. The other page is cal ...
Currently faced with the challenge of storing JSON data in a MySQL database, I am struggling to identify the most efficient method. { "id":"9", "title":"title", "images":[ { "image":"house.png", "width":"680", "height":"780" },{ "image":"car.png", "width" ...
I've encountered some issues with the code in my PHP/MySQL application. While it generally runs smoothly and takes about 3-4 seconds, the first execution (per session) can take up to 2 minutes. I suspect this delay is due to certain automated cache mechani ...
Currently, our main database connection is using mysqli. However, we are considering transitioning to Doctrine DBAL, which is built on top of PDO, a more flexible database abstraction layer. The game plan is to gradually shift from mysqli to DBAL while re ...
I am currently working on setting up a many-to-many relationship between my User model and Course model. Users can join multiple courses, and courses can have multiple users (students). To add a unique twist, I am adding a monthly quota of questions that u ...
I've encountered a recurring issue in my web application development projects and I'm looking for some advice on how to handle it more efficiently. Currently, when editing data with multiple relationships in an app that uses MySQL as the database ...
HTML file content <table mat-table [dataSource]="dataSource" class="mat-elevation-z8"> <ng-container matColumnDef="id"> <th mat-header-cell *matHeaderCellDef> No. </th> <td mat-cell *matCellDef="let element"> {{ele ...
I am currently in the process of creating a small CMS system and am looking to incorporate AJAX and jQuery into it. Although the code works fine without using AJAX, I am facing issues with data not being passed correctly. The AJAX success message displays ...
I have been experimenting with displaying images uploaded to the database using a simple insert form. So far, I have managed to retrieve the image name in the "data-file". However, I am curious about how I can easily display the actual image in the same lo ...
Is there a way to dynamically switch the database configuration for my pool in Node/Express application? I am using a REST API with node/express and have multiple databases. What I need is for the API to select the appropriate database based on the user.c ...
I work with Flex and PHP with a focus on querying MySQL databases to create XML files using PHP functions. Typically, the recordset can be extensive, containing around 90000 rows which slows down the generation of the XML file to approximately 50 seconds. ...
On each login, I retrieve the value of $_SESSION[balance] from a MySQL database. Is there a way to update this value in the client's browser every 5 minutes without refreshing the page? Could AJAX be used for this purpose? I apologize if my question is to ...
I'm encountering an unusual issue. I've defined a query to insert two names into the database, and I've used Javascript(Jquery) to ensure it only runs when the create button is clicked. However, the script seems to be executing every time I reload the page ...
I have stored the date in a MySQL datetime field as shown below: $current_date = date('Y-m-d H:i:s'); It will save the datetime like this: 2012-12-19 14:36:42. Now I need to retrieve the following data using a MySQL query: 1) Get all data tha ...
I am trying to calculate the average rating for each store in a directory list using MySQL's AVG function. Whenever someone reviews a store, they assign a rating ranging from 1 to 5. This rating is then inserted into the rating column of the reviews table ...
I have two different files, one named index.php and the other called get_content.php. Strangely, I am unable to display anything on the get_content.php file. I am now left pondering where the issue might be - in index.php or get_content.php? To view the F ...
I am currently tackling a school project and struggling to complete the registration page accurately. The data does not seem to be getting inserted into the table as intended. Please take a look at this screenshot of the database and table After reviewin ...
I am currently working on setting up a connection pool for queries in my project. I have created a simple class where the connection pool is assigned to a member variable. The issue I am facing is that even though the member variable is correctly set in th ...
TL;DR https://gist.github.com/anonymous/1e0faaa99b8bb4afe3749ff94e52c84f - Example demonstrating memory consumption indicating a potential leak issue. Is the problem in my code or within the mysql package? Extended Version : I've been noticing significa ...
I have a scenario with two different tables, NGO and Volunteer. When a volunteer selects an NGO to work with, I want to display only those volunteers who are interested in the current logged-in NGO. Below is the code snippet I am using: [<?php ...
Outside of regular operating hours, the database transitions into an Idle state. To re-establish connection to the data, I am using the code snippet below, var mysql = require('mysql'); var settings = require('./config.js'); var conne ...
There are two tables that are crucial for a trivia quiz game at this stage: scores and quiz. I have implemented multiple nested PHP and MySQL loops to achieve the desired results. However, I am seeking a more streamlined approach with potentially fewer dat ...
Struggling with Js and web development, I've scoured the web for a solution to no avail... After completing a project for a small lab, my current challenge is creating a login page and generating a web token using JWT... I successfully created a use ...
Having always been able to do something similar in other languages, I'm facing a few difficulties with PHP. My goal is to load a page that displays all the values from a form (created with a SELECT) and then update them all when clicking a "CHANGE" button ...
I am currently facing an issue while attempting to write to a database using PHP. Despite having asked for assistance from multiple individuals, the problem still persists. Therefore, I am reaching out in hopes that a fresh pair of eyes might be able to ...
I'm currently working on an Android application that interacts with a remote MYSQL database to retrieve information using JSON data. One of the challenges I'm facing is implementing a search functionality based on the userID in the app, and then displaying ...
I have a database that contains more than 10 SQL tables with employee details. Some tables only have single row details, like the basic details table which is the main table. In the second table, the contact table, I index this table with id=emp_id and lef ...
Exploring the idea of creating a LAMP web application that allows users to input their location. Considering integrating Google Map API to convert their locations into lat/long coordinates. Assuming every user has this information, I am looking for guidanc ...
I'm currently working on setting up a Node.js Express API to expose a MySQL table. Everything is working fine except for the part where I need to filter data by a current timestamp and update it every few minutes. I've tried using setInterval but ...
I have a unique and interactive Dynamic Sortable Table where I can effortlessly add or delete rows likethis uploaded image here. There is an intriguing loop in my controller that runs precisely 4 times, based on the number of columns in the table. However, ...
After setting up two tables, simplecomments and commentors, I linked them using an INNER JOIN. The Simplecomments table contains detailed information about each commenter, including their comment, registration date, and commenter ID. On the other hand, ...
My MySQL looping is not working properly when I click the second button to get their id and continue with the rest of the process. Why is this happening? $(document).ready(function() { $("#deleteSchedule").click(function (e) { e.preventDefault(); ...
Here is a table for reference: mysql> desc foo; +------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+--------------+------+-----+---------+------------- ...
Within my MySQL database, I have stored marker positions (along with additional information) that I successfully loaded onto a Google Map by following this example - http://code.google.com/apis/maps/articles/phpsqlajax.html Everything worked perfectly up ...
I attempted to create an activity that would update a MySQL database. Here is the code for the web server: <?php //error_reporting(0); require_once('db_config.php'); if($conn){ $sql = "UPDATE order_detail SET order_status ='co ...
Currently, my code retrieves data from a MySQL table and displays it on the page in a single line. However, I want to present this information in separate blocks. Is there a way to split the line and create distinct blocks of information that can be plac ...
Here is some PHP code: $handle = fopen($_FILES['filename']['tmp_name'], "r"); while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { $import="INSERT into info(tazkira,gender,province,category,clin,training) values('$data[0]','$data[1]','$data[2]', ...
Wondering if it's possible to retrieve groups as an associative array using SQL. I'm interested in understanding the capabilities of SQL and its potential for solving this particular issue. The challenge at hand involves a database containing a ...
Here is the code snippet that functions correctly by displaying content when the EditText field is left blank or contains a string value present in the MySQL database. However, I am facing an issue where I want to show an error message when the input from ...
After successfully implementing product filtering using Ajax and PHP on my real estate website, I'm now facing issues while trying to incorporate the functionality to order the results by price. Despite various attempts, I am unable to add the necessa ...
I am facing a challenge with JSON data being imported into my MariaDB/MYSQL database using Airbyte from an API query. I have been using JSON_TABLE to extract the JSON into columns, which has been working quite well. However, I recently noticed that there i ...
Hey everyone, I'm currently working on a simple registration form in PHP and no matter how many times I try to run it, all I get is a blank white page. There are no errors or outputs, just pure emptiness. I was hoping someone could shed some light on ...
Currently developing a PHP website. Can anyone provide guidance on how to substitute spaces in a URL with either dashes (-) or %20? Which function should be utilized to decode the URL? Is it necessary to modify anything in the .htaccess file? ...
I am currently attempting to create lambda functions in node.js using TypeORM with MySql. Despite installing all the necessary node modules, I encounter errors when deploying the lambda (via serverless) and testing it. The error message is as follows: I am ...
I currently have a spider and pipeline set up to extract data from the web and insert it into MySQL. This code is up and running smoothly. class AmazonAllDepartmentSpider(scrapy.Spider): name = "amazon" allowed_domains = ["amazon.com"] start_ ...
I am encountering an SQL query error with the second SQL statement in this code. I understand that the issue lies in escaping the single ' quote, but I'm unsure how to handle it within my parameters. This marks my first question. My second question pertai ...
I'm currently facing an issue with updating my database using PDO. While I can easily select data without any problems, the update function just doesn't seem to work. There are no error messages displayed, but after running the query, there are no changes ...
I'm currently working on integrating MYSQL with Python CGI-Bin. However, I keep encountering an issue that I can't seem to resolve. I am running this on a Windows 8 machine with Python version 2.7.8. I've searched online for solutions but have been unsucc ...
Currently, I am attempting to create an ajax dropdown search form that provides suggestions based on results from a MySQL database. The goal is for the user to be able to click on a suggestion and be redirected to the specific product. The code I am using ...
I am trying to display the number of news articles per year and month in the following format: 2013 October (20) November (45) September (80) 2014 January (5) This is what I currently have: $sql = "SELECT YEAR(FROM_UNIXTIME(timestamp)) AS YEAR, ...
I encountered an issue while working on a login form that communicates with the database using PHP at the backend. Even though I have verified the correctness of my login credentials, I am facing an error related to undefined array keys 'email and pas ...
Hey there, I'm trying to check whether the radio button in (photo_edit.php) is set to 0 or 1, but it seems like all fields are empty. <td> <p> <input type="radio" name="visible" id="visible" value="1" /><?php echo (@$ ...
Having developed a multilingual website using PHP and MySQL, I am currently facing issues related to robots, SEO, and search engines. This is mainly due to the fact that the language selection mechanism relies on cookies. The current process is as follows ...
I've recently implemented the search functionality using AJAX jQuery, but I am facing a problem. Currently, when I type something in the search field, the search list displays accordingly. However, upon refreshing the page, the search results disappear. Th ...
There is a page '/order/new' with 2 dropdown menus for customer and their address, along with a button that redirects to choose products to add to the order. The selected products are saved in an array called 'hh' which receives data from an AJAX call. How ...
After browsing through similar questions and attempting to implement it on my website, I'm facing an issue where the expected functionality is not working as intended. When users click on a link, there is no response in the console, and the database r ...
Just a quick note - I'm a total newbie in the world of web development, so I might be missing an obvious solution here. My challenge is to insert a dataset into a MySQL database using nodejs/expressjs/mysql. I've managed to establish a connection to the ...
While parsing data from a text file to a MySQL database, I encountered an issue after processing a certain number of records (approximately 250,000 to 380,000). The error message Fatal error: Maximum execution time of 30 seconds exceeded appears. Splitting ...
Upon a user clicking and selecting a client, I would like to dynamically update the region dropdown menu with options that are related to that specific client from the databaseenter code here This is my client table: Here is the Region table, where clien ...
When attempting to execute a SQL selection using PHP variables, I encountered an issue with the following code: $st=$_POST["st"] ; $tu=$_POST["tu"] ; $data=$_POST["data"]; $ec= $_POST["ec"] ; $sql="SELECT nr, '.$ec.' FROM 'report' WHERE st='.$st.' and t ...