Search Posts

Connect two different Database with one application in ASP.NET

I am trying to connect Sql server and MySql database with my application in Visual studio. Is it possible to connect multiple database with one application. Because i have to import data from mysql in my application. There is lot data in mysql database. So, i am thinking to connect to mysql as well as my current database (sql server). is there any way, please let me know. Thanks Source: Stackoverflow

How to create a session Login

i’m trying to create a login session from an html form that send data to a mysql db, check for credentials and start a session for each pages that the user will visit. The problem is that i’ve seen just <?php session_start(); if (!isset($_SESSION[“login”]) || $_SESSION[“login”] == “”) header(“”); else header(“Location:login.php”); ?> <html> <body> … <body> <html> but i don’t like to have php code together with html. Actually i have a folder with all […]

Call link to modal on successful Ajax call

If I wanted to pop up a particular modal currently I’d add this HTML and click the link… <a data-deploy-menu=”notification-modal-3″ href=”#”>Demo</a> However I want to remove link and call the modal on a successful ajax call. Somethinkg like the below, but unsure how to do it. Please can you help? jQuery.ajax({ url: “http://localhost/timesheets/mobile/add-timesheet.php”, type: “POST”, data: form.serialize(), crossDomain: true, datatype: “json”, cache: false, success: function (data) { var jsArray = JSON.parse(data); console.log(jsArray); if ($.trim(jsArray.success) === […]

Avoide duplicate id in the response

I am trying to accomplish the following sql statement but I am getting one duplicate id in my response. SELECT ci.customer_id, ci.first_name, ci.user_gender, ci.customer_status, fr.relation FROM customerinfo ci INNER JOIN familyrelation fr ON ( fr.personid_two = ci.customer_id ) WHERE ci.customer_id IN (SELECT personid_two FROM familyrelation WHERE personid_one = 17) AND ci.csp_user_id = 5; When i run this query, I am fetching the proper result, but one customer_id is getting repeated. Any help/advice greatly appreciated. Source: […]

Weird behavior in MySQL Table

We are using pymysql to import data from our Windows Network Desktops to our Ubuntu Server database for Superset. For intern reasons we need to drop the table and create it as a new one every time when we import our dataset. Everything is working fine, except this error in the first tablecolumn. So the Tablecolumnname Gesellschaft will be changed to ?Gesellschaft in superset. It doesn’t matter which word we use, it is always the […]

Finding the parent id

I have the joined table: It consists of table1: And table2: In accordance with the fields t2.uf_sap_code and t2.uf_sap_code_parent I need to find the parent and will fill their the field of t1.iblock_section_id. I’m trying to solve this by writting the recursive function, but no success: $query = $DB->Query(“SELECT,, t2.uf_sap_code, t2.uf_sap_code_parent FROM b_iblock_section AS t1 LEFT JOIN b_uts_iblock_5_section AS t2 ON = t2.VALUE_ID WHERE IBLOCK_ID = 5”); $categories = array(); while […]

Too many connection when extending PhalconDbAdapterPdoMysql

I’ve attempted to extend the PhalconDbAdapterPdoMysql to create a log every time a query function returns false. Even though I’m not creating any new connections except the one in parent::__construct I’m getting the following exception: Fatal error: Uncaught PDOException: SQLSTATE[08004] [1040] Too many connections in …Internal/Database/Mysql.php:14 Stack trace: #0 [internal function]: PDO->__construct(‘mysql:adapter=M…’, ‘…’, ‘…’, Array) #1 [internal function]: PhalconDbAdapterPdo->connect(Array) #2 …/Internal/Database/Mysql.php(14): PhalconDbAdapterPdo->__construct(Array) #3 …/apps/bootstrap/app.php(378): InternalDatabaseMysql->__construct(Array) #4 [internal function]: Closure->{closure}() #5 [internal function]: PhalconDiService->resolve(NULL, Object(PhalconDiFactoryDefault)) #6 […]

How to copy data from 1 table to another with different structure

I have a table with the structure CREATE TABLE `old_reminder` ( `id` int(11) NOT NULL AUTO_INCREMENT, `applicant_id` int(11) NOT NULL, `date` datetime NOT NULL, `type` enum(‘payment_15_min’,’payment_1_day’,’payment_3_day’) NOT NULL DEFAULT ‘payment_15_min’, PRIMARY KEY (`id`) ) and I want to migrate its data to another table with the structure CREATE TABLE `new_reminders` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `user_id` int(11) DEFAULT NULL, `payment_reminder_1_count` int(11) DEFAULT NULL, `payment_reminder_1_date` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) basically multiple […]

how to select to count with mysql

i want to count with using select, count, and group by. it work with MariaDB but not working wit MySQL. i dont know if that version of mariadb or mysql but this code working in localhost but not working in my vps. here my code SELECT date, COUNT(id_master_post) FROM master_post GROUP BY DAY(date) ASC; error i get. SELECT date, COUNT(id_master_post) FROM master_post GROUP BY DAY(date) ASC LIMIT 0, 25 MySQL states: Documentation .#1055 – Expression […]

Next Page » « Previous Page