I am trying to select all rows from all tables in the database when a column equal a given name. I have like many tables with same structure and columns. I have written this piece of code but it throws an error. SELECT GROUP_CONCAT(qry SEPARATOR ' UNION ') INTO @sql FROM ( SELECT CONCAT('SELECT * FROM `',table_name,'` where Name like ''','sally%','''') qry FROM ( SELECT distinct table_name FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = 'db_customers' AND column_name LIKE 'Name' ) A ) B; PREPARE s FROM @sql; EXECUTE s; DEALLOCATE PREPARE s; This is the error I am getting. I am aware …

Member Avatar
Member Avatar
+0 forum 3

I have spent a lot of time on this question, namely, how to programatically use a PHP script to send a PDF document to the printer without launching the Adobe print dialog that results from using arcord32.exe (the adobe reader). PHP has some useful classes for creating PDF's, i.e., the FPDF library, but printing the created file is a bear. For Windows XP and Windows 7 servers, the one open -source solution which works is to use the PDFBOX java library. Here are the steps. 1) Download the latest java pdfbox binary: http://www.apache.org/dyn/closer.cgi/pdfbox/1.7.1/pdfbox-app-1.7.1.jar and put it in a directory. I …

Member Avatar
Member Avatar
+6 forum 14

I have two tables. MODELS and AUTOMOBILES. And procedure which export all models with name that user inputs and their price(stored in AUTOMOBILES). create or REPLACE procedure modelzz( VAR_MODEL IN MODELS.NAME_MODEL%TYPE, VAR_PRICE OUT AUTOMOBILES.A_PRICE%TYPE ) as begin SELECT a.A_PRICE INTO VAR_PRICE FROM AUTOMOBILES a join MODELS m on a.MODELS_ID_MODEL=m.ID_MODEL where m.NAME_MODEL=VAR_MODEl; dbms_output.put_line(VAR_MODEL||'''s price is : '||VAR_PRICE); procedure start: var v_modelzz varchar2; exec modelzz('&model_name',:v_modelzz); The problem is I want to export all records for certain model. Their's more than one, one model can have two or more records. Here's the error: **exact fetch returns more than requested number of rows**

Member Avatar
Member Avatar
+0 forum 5

**problem** How to get cost per hotel and flight then add it in duration cost table based on flight date automatically . **Details** suppose i write flight date 26/07/2017 alexia 8days 04/08/2017 it must automatically get cost from hotel price table and price from flight then add it in duration cost table so that what query i write to get cost per hotel and flight when write flight date then insert it to duration cost table my database CREATE TABLE program( ProgramID int primary key not null, ProgramName varchar(30) ) GO insert into program values(1,'Alexia'),(2,'Amon'),(3,'Sfinx') GO CREATE TABLE ProgramDuration( DurationNo …

Member Avatar
Member Avatar
+0 forum 1

HI, I have recently upgraded my mysql database to version 5.1.72 community log. I am having an issue that all my select queries are showing the columns as NULL if there is no entry added for a specific column. For exmaple I have a table table_employee and the employee name is entered as empty. When I run the select query and display the record it shows NULL instead of empty space. I am trying to get it fixed through my.ini settings in mysql. Is there any I can handle this through my.ini settings or do I have to put the …

Member Avatar
Member Avatar
+0 forum 2

As it seems to come up often enough I figured I'd throw together a quick snippet outlining basic methods for data manipulation in SQL Server using C#. In all examples the coder will need to substitute their own connection string details and variables. I utilised parameters for 3 of the examples but they can just as easily be replaced by direct references to dynamic controls in your application if desired. The benefit of parameters, however, is that they set the 'type' of the variable being passed and add an additional level of type checking to the app. I'm hoping I …

Member Avatar
Member Avatar
+2 forum 13

Hi hope you can help me. I have studied a lot to make my website using php and mysql and I know how to insert data in a table from a form, how to select and display data on page etc. Lately I got involved with wordpress which is a great CMS. The only problem is so different and is driving me nuts, also because I find no help in the various tutorials online. I have some simple questions. 1)Can you tell me how to insert data into a tablepress table from a form (my site is about hotel booking)-2) …

Member Avatar
+0 forum 0

Hi all, I'm working on a SQL procedure to insert a row for new clients based on a template account that already exists in the database. I thought about Declaring a variable and selecting the value from the table one at a time, but with many columns needed, this seems inefficient. Sample Query: DECLARE @Template_Account decimal(10,0) = 8; DECLARE @Field1 ntext = (SELECT Field1 FROM cltClients WITH(NOLOCK) WHERE ClientNumber=@Template_Account) DECLARE @Field2 ntext = (SELECT Field2 FROM cltClients WITH(NOLOCK) WHERE ClientNumber=@Template_Account) DECLARE @Save1 bit = (SELECT Save1 FROM cltClients WITH(NOLOCK) WHERE ClientNumber=@Template_Account) DECLARE @Checkin1 bit = (SELECT Checkin1 FROM cltClients WITH(NOLOCK) …

Member Avatar
Member Avatar
+0 forum 3

Well if you were like me and Python is your first language. You are trying to learn programming and many people suggested that learn Python as a first language. You take their advice, your download Python and get all set up. Maybe you take a tutorial or two in order to learn some basic syntax... Now you are sitting in front of your computer and you are wondering what to do next. I suggest you start on some projects and get programming to learn more Python. I have created all the projects myself, and will include the source code in …

Member Avatar
Member Avatar
+2 forum 12

I want to retrive data from two tables. I used below code : (SELECT sum(total_amount) as tr from loan where loan_status = 'not finish') union (SELECT sum(amount) as tt from settlement where sett_status = 'Active') But It load data by one column and these two values load under the another values I want to recieve those values to two columns... Becuase I want to retrive these to vb.net variable for make chart.

Member Avatar
Member Avatar
+0 forum 4

i am able to populate data in chain select drop down list but the problem is when page is refreshing selected data is lost how to fix that .. here is the code.. <?php require_once 'include/config.php'; require_once 'include/opendb.php'; ?> <?php if(isset($_POST['model'])){ //This is for the third and final drop down menu. It allows you to submit and go to new page. $link="index.php"; }else{ //This is for the third and final drop down menu. It allows you to submit and go to new page. $link="#"; } ?> <form method="post" action="<?php echo $link;?>" name="admin"> //Straight Forward <select name="value1" onChange="this.form.submit();"> // 1Ste Drop …

Member Avatar
Member Avatar
+0 forum 7

I needed a script that would grab all the folders in the directory and add them to a dropdown list and allow the user to upload to there choosen folder. This is what i came up with. (upload script is not mine) Thought i would share.

Member Avatar
Member Avatar
+0 forum 5

The Code Given is for only beginners in HTML 1.The code implements a simple login form 2.It checks whether the password and usernames are matching or not 3.While you are using replace the predefined username and password that I'v given that is replace "myuserid" and "mypswrd" with your own userid and password. 4.just copy the file and paste it in the notepad. 5.and save it with an extension of .html or .htm 6.select 'All Files' from the popupmenu shown at the bottom of notepad before saving. 7.Now you will get a document that has the symbol of internet explorer. 8.just …

Member Avatar
Member Avatar
-2 forum 34

I am banging my head again, and appologise if such a qestion has been posted and answered - i searched and could not see any results matching my question. I have a datagridview1 full of data, one column has a date and another a qty. datagridview1 Date Qty 2015-11-05 | 44 2015-11-09 | 12 2015-12-04 | 100 2016-01-15 | 10 2016-01-26 | 15 My loop takes too long to add up the Qtys by month and year. esp when the file is 2mb or more. SO my idea is to put the data into a datatable andquery it from there. …

Member Avatar
Member Avatar
+0 forum 1

Hi everyone! I am in major need of some help here and before I go off and write a SP to handle this for me, I though I would ask here for advice first. I am writing a report to display on our asp.net site using the ReportViewer component and the report editor in VS. We have a SQL table that contains a DateTime field (two actually) and those fields also accept null values. The report I am writing in ASP.NET needs to select the data from the table and determine if the DateTime field is null to show certain …

Member Avatar
Member Avatar
+0 forum 4

I have a SQL Server bank account table which contains ... ID (Identity) Trdate (Date), Description (Varchar), Debit (Money), Credit (Money), Balance (Money) Details (Varchar) I want to list a subset of the transactions between two dates (the period of an Australian Financial year) and the query below works correctly Select ID, TrDate, Description, Debit, Credit, Balance, Details From Bank_Acct Where TrDate Between '2009-07-01' and '2010-06-30' Order By TrDate, ID but I want to also add into the result set another record at the beginning which is the opening or brought forward balance for that period and the query below …

Member Avatar
Member Avatar
+0 forum 2

I used below select query to select information from two tables. But it show one record. How to change this code to view all records ? select loan.loan_id, loan.customer_name, loan.total_amount, ifnull(sum(settlement.amount), 0) as 'Total Received', ((loan.total_amount) - ifnull(sum(settlement.amount), 0)) as 'Total Due' from loan left join settlement on settlement.loan_id = loan.loan_id where loan.collector_name='kapoor' There are two loans which are collected by **kapoor**. But it show one record. Guys help me .......

Member Avatar
Member Avatar
+0 forum 2

hey, Previously I post my question. But it wasn't helped. So I tried own and make sum query. It's not generate 0 value records. can anyone hep me ? select loan.loan_id as 'Loan ID' ,loan.customer_name as 'Customer Name' ,loan.total_amount as 'Total Amount' ,ifnull(sum(settlement.amount),0) as 'Total Received' ,((loan.total_amount)-ifnull(sum(settlement.amount), 0))as 'Total Due' from loan inner join settlement on loan.loan_id = settlement.loan_id where loan.collector_name='kapoor' group by loan.loan_id By this code 2 records shows. But there is another loan collect by kapoor. And that loan still not collected ant payment. So I wanted to show Total Received = 0 Can help ?

Member Avatar
Member Avatar
+0 forum 3

hello everyone... can you please help me with the project that im building... my project has a combobox with the items of january-december... a listview with a 14 column. in the first column is name, the second is year and the rest is the month starting from january to december, at the last column is the total of the column in january to december. i can display all the data in listview to mysql.. my problem is i wanted to select a certain month from the columns and display the total of that column in a label... i hope you …

Member Avatar
Member Avatar
+0 forum 1

SELECT blabla FROM a INNER JOIN b ON a.a = b.b Is what I have. However I'd like to sort the results DESC by ID. I'd like to select last [`variable` x 10] of items sorted by ID DESC. Variable provided by PHP (I'll sort things out, I just need help with the query itself).

Member Avatar
Member Avatar
+0 forum 3

i have a problem in showing two columns which is reff_number and Name in a combobox/select box, and now i can only display one column with it, if i have 9000 customer(in bahasa = pelanggan) , it will take an effort to find for user, and it will be easy if not only name but sho reff_number, please help me, thanks before select name="cmbclient"> <option value="blank"></option> <?php $datasql="SELECT * FROM pelanggan ORDER BY name; $dataQry=mysql_<select name="cmbclient"> <option value="BLANK"> </option> <?php $dataSql = "SELECT * FROM pelanggan ORDER BY name"; $dataQry = mysql_query($dataSql, $koneksidb) or die ("Gagal Query".mysql_error()); while ($dataRow = …

Member Avatar
Member Avatar
+0 forum 9

I think this is called "foreign key" and "local key" ? I have a table `users`, these users have `rank`. It's an `int`. There is a table named `rank`, this table has field where hexadecimal string is placed `FF0000`. Is there a way to `SELECT * FROM users` and `SELECT * FROM rank WHERE id=users.rank`... or something?

Member Avatar
Member Avatar
+0 forum 10

How do i get the most repeated value that is inserted just today from 23:59 till 00:00 i have this sql but i dont know how to filter it by date any help will be apreciated. $sql = "SELECT `MatchTitle`, COUNT(`MatchTitle`) AS `mostPlayed` FROM `matches` GROUP BY `MatchTitle` ORDER BY `mostPlayed` DESC LIMIT 1";

Member Avatar
Member Avatar
+0 forum 1

Hey ! I'm looking for sql 'like' command help.... I had mysql database and it had settlement table. On that table there is column named 'settlement'. In the settlement column there are so many amounts..... Now I want to find recors '0 values' Can anybody help me ?

Member Avatar
Member Avatar
+0 forum 4

Hello, I was looking for some help with the below query. I need to only return the first 'Carton.CartonNumber'. I tried adding something like ( Select Min(Carton.CartonNumber) as FirstCarton from Cartons group by Carton.ID) dispite much Googling but cant get it right because of all the other joins confusing me. Please could you assist? Thank you SELECT OrderLine.LineNo, Order.OrderNumber, Order.Description, WarehouseOrder.WhsRef, WhsPick.PickRequired, WhsPick.PickAvailable, WhsPick.EstimatedDispatch, Carton.CartonNumber FROM WhsPick INNER JOIN WarehouseOrder ON WhsPick.ID = WarehouseOrder.PickID INNER JOIN OrderLine INNER JOIN Order ON OrderLine.OrderID = Order.ID ON WarehouseOrder.ID = Order.WarehouseOrderID INNER JOIN Carton ON WhsPick.ID = Carton.PickID

Member Avatar
Member Avatar
+0 forum 9

hi thrr is no one who can help me this is the prog which when i run faces problem of session. [B][U]session_start(): Cannot send session cookie - headers already sent [/U][/B] pls plssssssssss help me to solve the problem below is the code any one this is simple prog but i can't run if i can't run thn my boss will kick me out of the office. so pls hlp me. [php]<?session_start();?> <?php include"db_config.php"; $connect = mysql_connect("$db_host", "$db_user", "$db_password"); mysql_select_db("$db_name", $connect) or die(mysql_error()); $f_name= $_POST['fname']; $l_name= $_POST['lname']; $pass= $_POST['password']; $query = "SELECT * from helpagent WHERE first='$f_name' and last='$l_name' and …

Member Avatar
Member Avatar
+0 forum 13

Hi this is giri i need ur help that is i am trying to select two drop down option in html and i want compare to options if those options are equal than it as two redirect to respective page ,will u please provide with a code . thank you

Member Avatar
Member Avatar
-1 forum 4

Hello everyone. Please help me. Select box <select> is not working in phonegap app only on gingerbread. It works on iOS and Adroid ice cream sandwich + jelly bean. I use jquery 1.9.1 and iscroll 4.2.5 and phonegap 2.3.0. Does anyone has any idea why would it work in ics and jb but not in gb?

Member Avatar
Member Avatar
+0 forum 10

HeY First I'm new to software developing side. I made some system abount money lending and some my teachers said that system good but there is wrong thing at finding profit/loss page. Therefore I want your advices guys ! :) In this system user can register new clients and also their loans. Another form is there for collect settlments from one who brought loans. I need to find profit/ loss. But some clients pay different amounts for there daily settlments. Then I can't just say this is capital and this is interest income by one settlment. What should I do …

Member Avatar
+0 forum 0

I'm making money lending system. On that I use mysql database. I want to find customer's who skipped their daily instalment. I try this code. But It has error. ***Prveious code:*** SELECT l.loan_id, l.custormer_id,custormer_name FROM loan l JOIN income i ON l.loan_id = l.loan_id WHERE l.loan_id NOT IN (SELECT loan_id FROM income WHERE date_received = curdate()) and loan_status = 'not finish' I have CUSTOMER,LOAN,INCOME tables. On customer table it holds all deatails of custormers. On loan table it holds all details of loans. On income table there are columns which named receipt_no, customer_id,loan_id,date_received and amount. Above PREVIOUS CODE show all …

Member Avatar
Member Avatar
+0 forum 2

The End.