2,403 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for berserk

I am in need of help on this one :( i cannot seem to figure out what i have done wrong, i set up my code just like in teh examples i read and i dont really see anything wrong with the logic (as far as i can tell) but …

Databases html-css mysql php
Member Avatar for berserk
0
326
Member Avatar for olavbundgaard

The database that I'm working for has been suddenly corrupted. Fortunately, I performed a backup on it and save to a backup tape. Therefore, I reinstalled SQL Server and I tried to restore those backup. However, it failed and I suspect that maybe the backup is corrupted too as well. …

Databases client-server mssql sql
Member Avatar for theodorrinder
-1
1K
Member Avatar for Kubilay Doğukan

This is the table that gives error -- ----------------------------------------------------- -- Table `mydb`.`Supervise1` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `mydb`.`Supervise1` ( `S1_Date` VARCHAR(45) NOT NULL, `S1_Contracter` VARCHAR(45) NOT NULL, `S1_Contractee` VARCHAR(45) NOT NULL, `S1_ID` VARCHAR(45) NOT NULL, PRIMARY KEY (`S1_Contracter`, `S1_Contractee`, `S1_Date`, `S1_ID`), INDEX `Contracter_idx` (`S1_Contracter` ASC), INDEX `Contractee_idx` (`S1_Contractee` …

Databases mysql sql
Member Avatar for Kubilay Doğukan
0
289
Member Avatar for donz365

I am sorta new to MySQL and not 100% sure of what I can and can not do with it yet. I have an xml file with course information such as ReferenceNo. CourseName, CourseType, CourseLocation, and I want to load in into a database table that has column names such …

Databases mysql xml
Member Avatar for diafol
0
2K
Member Avatar for Joemeister

I'm trying to do a simple a database SQL script where I simply need tocreate a database as well as 4 tables within. So far I'm getting a very annoying error that states: There is already an object named 'DEVICE_TYPE' in the database. Why, I don't know? Any help regarding …

Databases mssql
Member Avatar for erikko
0
287
Member Avatar for Maideen

Hi I am working in weekly Newspaper company. There are 15000 subscriber, subscribed for next 3 to 4 years.Per year 52 weeks and I have to generate issue number based on week(1001......3000) for each subscriber and store into data table. I am using mssql 2012. I have written the Store …

Databases client-server mssql sql
Member Avatar for erikko
0
328
Member Avatar for boney

Hi, My query: $query = "select * from ( select * from students union all select * from students ) as tmp order by rand() limit 5"; $myquery = mysqli_query($db_connect, $query); while($students = mysqli_fetch_assoc($myquery)){ $stdid =$students['stdid']; $name = $students['name']; $dept = $students['dept']; echo "<br><br>".$stdid."<br>".$name."<br>".$dept; } There are 20 rows for …

Databases mysql sql
Member Avatar for JorgeM
0
157
Member Avatar for davy_yg

// this works sql = "SELECT * FROM `image_upload` WHERE location='article' AND image_id='7'"; // this works sql = "SELECT * FROM `image_upload` WHERE location='article' AND image_id='9'"; // this does not work sql = "SELECT * FROM `image_upload` WHERE location='article' AND image_id='7' AND image_id='9'"; // I wonder why?

Databases mysql sql
Member Avatar for DaveAmour
0
151
Member Avatar for nimz143

Hello :) I'm trying to create web application. I followed the tutorial given in this site : http://aspsnippets.c...-in-ASPNet.aspx My problem now, after I create a table and the UI. Next step show about stored procedure. What is stored procedure use for? Do I need this even though I had a …

Databases mysql sql
Member Avatar for nimz143
0
274
Member Avatar for k_manimuthu

Hi All, I want to copy the missing 'data' field from 'tb1' to 'tb2' based on the 'id' value. Please suggest the possible queries. mysql> select * from tb1; +------+------+ | id | data | +------+------+ | 1 | A | | 2 | B | | 3 | C …

Databases mysql
Member Avatar for k_manimuthu
0
317
Member Avatar for Trench37716

I am calling data from my database but the result is not what I want. Below is my code: Select distinct concat(ImporterDistributor.name, '/', ID.name) as [Distributor_Importer], case when Product_Delivery.Product=1 then isnull(max(Product_Delivery.Opening),0) end as OpeningPMS, case when Product_Delivery.Product=2 then isnull(max(Product_Delivery.Opening),0) end as OpeningAGO, case when Product_Delivery.Product=3 then isnull(max(Product_Delivery.Opening),0) end as OpeningATK …

Databases mssql
Member Avatar for Trench37716
0
202
Member Avatar for Joemeister

I am quite new to SQL but I was wondering how to achieve the following. How do I get specific values that fall in the year 2013 when the date format in the table is looking something like this: 1 94 pH 02-02-2012 11:48 AM 1200001 2 103 pH 09-06-2012 …

Databases mssql
Member Avatar for Reverend Jim
0
174
Member Avatar for Joemeister

I want to know how to achieve the following: I want to convert a varchar to a date format but so far I'm not very successfull... My date (varchar) looks something like this: 02-02-2012 11:48 AM And I want to convert it to the following this: dd-mm-yyyy To be able …

Databases mssql
Member Avatar for Joemeister
0
300
Member Avatar for Gangotri
Member Avatar for pixelsoul
-2
181
Member Avatar for bnmng

Should I put an effort into avoiding updates when the data on a submitted form is unchanged from the data already stored? Is it worth it to query the database before updating? For a specific example of what I'm talking about, say I use php to generate a form as …

Databases
Member Avatar for minitauros
0
173
Member Avatar for bolfescu

hy i'm having problem with this mysql qry, i dont whant to insert in the db if its empty the field, ive tryied with is NULL, but its not working... $qry=mysql_query("INSERT INTO trans_autista (autista, ditta) SELECT * FROM (SELECT '$trans_autista', '$cat') AS tmp WHERE NOT EXISTS ( SELECT autista FROM …

Databases mysql
Member Avatar for bolfescu
0
222
Member Avatar for subbu_1

I have a database table named with books. it consists of something like below ex database given below, user is trying to search the value by author or title and based on category ex: if user search for adapt by selecting fiction need display both adapt and adaxx below is …

Databases mysql
Member Avatar for subbu_1
0
198
Member Avatar for subbu_1

if query passed in search box by selecting the category as fiction or whatever it may be, it should search in both title and author, if value got in title then no need to search in author, if not need to search in author, $search = $_POST['searchvalue']; //assume search value …

Databases mysql
Member Avatar for subbu_1
0
271
Member Avatar for asaidi

Hi how i can use this sql in php.. SET @a = 0; UPDATE van SET position = @a:=@a+1 where day='2';===>can be variable it goes from 2 to 30 thanks

Databases mysql php sql
Member Avatar for asaidi
0
284
Member Avatar for kevwood

hi all, i had this code working yesterday (to an extent any way lol). the first part of the code seems to be working correctly an tells me i am connected to the db. but then i am getting a an error saying no db selected. here is the code …

Databases mysql
Member Avatar for kevwood
0
200
Member Avatar for Santanu.Das

What is difference between MySQl & MSSQL database storage limitation. More descriptively, If I make databases using the above-mentioned database systems. How much data I can store in each of them, i.e. 1GB, 2GB, 10GB, 100Gb. What is the limitation?

Databases mssql sql storage
Member Avatar for Santanu.Das
0
160
Member Avatar for ehpratah

Hi everyone i need some help down here. i am trying to connect multiple db and at the same time i want to sum the value of the column. what i have right now is this SELECT SUM(total) as branch1sales FROM icm.sales UNION SELECT sum(total) as branch2sales FROM hism.sales its …

Databases mathematics mysql
Member Avatar for ehpratah
0
335
Member Avatar for asaidi

Hi i m trying to count all for example vans who has record as Van1,Van2 ETC... physically in the database i have more than 200 Van1 ..but with select count gives me only 6.. SELECT COUNT(*) FROM route WHERE van='Van1' the rsult only 6 for others 0 and so any …

Databases mysql
Member Avatar for asaidi
0
142
Member Avatar for showman13

Good Morning, This may be a simple yes or no, or hopefully if it is a no, someone can tell me how to work around it. I have a table that includes 4 columns named the same with incremented numbers in the names step1 / step2 / step3 / step4 …

Databases mysql
Member Avatar for showman13
0
134
Member Avatar for fireburner29

Hi, i developing web application in core php. we have five panels superadmin, admin, medical, staff, customer. all records should be display superadmin and created by users. please help me to write a mysql query below my basic query. $user = $DB->prepare("SELECT `u_userid`, `u_username`, `u_password`, `u_rolecode`, `firstname`, `lastname`, `sex`, `age`, …

Databases display mysql php
Member Avatar for fireburner29
0
356
Member Avatar for VernonDozier

I have a Yahoo website that uses phpMyAdmin. I've been given the directive "Please run the script mysql_fix_privilege_tables that should be included in your MySQL server distribution to solve this problem!" I do not know how to run this script (or any script) through phpMyAdmin. I've been looking online and …

Databases mysql php
Member Avatar for Nishant_3
0
3K
Member Avatar for JayGeePee

I'm sure this is simple, but I'm having a time trying to figure out how to add two fields from two different tables together. <?php include_once('conn/db.php'); $query = "SELECT SUM(`sold`) AS total FROM veggies"; $stmt = $con->prepare( $query ); $stmt->execute(); while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){ extract($row); echo "<small><u>Plants Sold</u>: {$total}</small>"; } …

Databases mathematics mysql
Member Avatar for Reverend Jim
0
297
Member Avatar for joshmac

I am trying to come up with a query to track a student cohort based on their start term. I want to see if the number of students that started in 2012 actually go down in 4 years time. For this example I am starting with fall 2012 (12/FA). I …

Databases mysql sql
Member Avatar for joshmac
0
208
Member Avatar for Baradaran

Hi, I have a sql statement which was running fine yesterday. After making a few changes to the website, it stopped working. I managed to get the statement work on my localhost, however, when I publish the same pages onto the server, I receive the "Operand should contain 1 column(s)" …

Databases mysql
Member Avatar for tmlslvn6
0
2K
Member Avatar for showman13

I know there are a lot of articles about random numbers, but can't find an efficient way to do what I need. if I have a table that is designed with an auto increment ID for each record, it would be pretty simple to get the min and the max …

Databases mysql
Member Avatar for showman13
0
234
Member Avatar for PerpyProgrammer
Member Avatar for PerpyProgrammer
0
107
Member Avatar for jean_5

I have the following table: Region IdDescription IdUser Metropolitan Right 5 Metropolitan Left 6 Metropolitan Right 5 Metropolitan Left 6 Country Town Right 5 Country Town Left 6 Country Town Right 5 Country Town Left 6 Metropolitan Right 7 Country Town Left 8 And I want to query the kinds …

Databases mssql
Member Avatar for Taywin
0
106
Member Avatar for SimonIoa

I am starting to use Flash Builder for php to make an app. I have started with this very good example suggested by a user. [http://files.zend.com/help/Flash-Builder-for-PHP/Getting-Started/Mobile/build_a_mobile_(php)_application.htm](http://files.zend.com/help/Flash-Builder-for-PHP/Getting-Started/Mobile/build_a_mobile_(php)_application.htm) On Step 11 running the PHPUnit i am getting this error PHPUnit_Framework_Error_Warning:mysqli_connect()[<a href='function.mysqli-connect'>function.mysqli.connect</a>]:MySQL server has gone away I am understanding that it cant connect …

Databases mysql php
Member Avatar for SimonIoa
0
357
Member Avatar for bolfescu

hy, i'm having a big problem, thats because i'm new in this, i have two qrys unfort doesnt work if(isset($_GET['id'])){ $id=$_GET['id']; $qry=mysql_query("SELECT *,replace(category, ',', ' ') as category FROM articles WHERE id='$id'", $con); $sql = mysql_query("select *,Total17,sum(q5) Total18,sum(aste3) Total19 from articles where category= how ?",$con); if(!$qry){die("Query Failed: ". mysql_error()); } …

Databases mysql sql
Member Avatar for Traevel
0
179
Member Avatar for nevek

Hi I have a stored procedure with a cursor which check if a field is filled in after a certain deadline. DELIMITER $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `controleDeadlines`() BEGIN #declaratie variabelen die nodig zijn declare cId int; declare cDeadline text; declare cUitgevoerd date; declare cOpmerking text; declare cStatus text; declare DONE …

Databases mysql
Member Avatar for nevek
0
286
Member Avatar for Violet_82

Hi guys, I hope this is the right section to post. I need to develop an application in visual studio 2012 that uses SQL (please bear with me as I'm not very well versed in databases and SQL and therefore I don't know what SQL visual studio uses), and when …

Databases mssql sql visual-studio
Member Avatar for Violet_82
0
602
Member Avatar for AntonyRayan

This is my output tabe: name SUM(billing.quantity) SUM(billing.total) SUM(billing.discount) SUM(billing.price) pen 4 40 8 32 pencil 3 15 2 13 rubber 1 2 1 1 Using : SELECT productmaster.name, SUM(billing.quantity), SUM(billing.total), SUM(billing.discount), SUM(billing.price) FROM billing AS billing LEFT JOIN productmaster AS productmaster ON (productmaster.id = billing.pid) GROUP BY billing.pid ORDER …

Databases mysql
Member Avatar for AntonyRayan
0
180
Member Avatar for AntonyRayan

This is my billing table in my sql: id pid quantity total discount price customer 1 1 2 20.00 5.00 15 a 2 1 2 20.00 3.00 17.00 a 3 2 3 15.00 2.00 13.00 b 4 3 1 2.00 1.00 1.00 a This is my product master table id …

Databases mysql sql
Member Avatar for AntonyRayan
0
234
Member Avatar for Jesi523

Hello, I need a little help with trigger, I have been doing database development for a long time now but this is my first go around at a trigger. It is not working, can someone please look at this and let me know what I am doing wrong: ALTER TRIGGER …

Databases mssql sql
Member Avatar for Dani
0
203
Member Avatar for joshmac

I was wondering if the following was possible with a query? If so, can someone give me an example query? I want to print a list of products, group them by color, and then have the totals at the end of each group. | Color | Product | ------------------- | …

Databases mysql
Member Avatar for joshmac
0
133
Member Avatar for joshmac

I am trying to do a check to see if a student meets the prerequisite before they can register for a course section. CourseSecID = 27 (ID of the course section the student wants to register for.) What I am doing is querying the student's acad cred records to see …

Databases mysql sql
Member Avatar for joshmac
0
235
Member Avatar for Lethugs

Hi, Im trying to extract data from sql server where conditions are multiple and variying I have a datagridview with 2 columns ID and Name I need to create Select Query to extract data where condition is 'ID should be equal to the value or values in Datagridview ID Column. …

Databases mssql sql
Member Avatar for Lethugs
0
269
Member Avatar for rony001

hello friends I have two tables with column A and column B. I want to update column B of table2 with column B of table1 . I have trying this query in ms access from Vb.net. update table1 t1 LEFT JOIN table2 t2 on t1.a = t2.a SET t2.b = …

Databases mssql sql
Member Avatar for isozworld
0
285
Member Avatar for showman13

Good afternoon, I'm drawing a complete blank on this, and decided someone in here could answer the question for me without an issue. I have a mysql DB with thousands of records in it, and over time have used an inadequate system for maintaining terminated records. I've been simply prepending …

Databases mysql
Member Avatar for showman13
0
257
Member Avatar for Gaurav arora

Hi all, I have created a table in which i have a DateTime Column . i need that i dont want to insert values in that column from the front end. i have created a trigger for that purpose. whenever i insert a row in that table the dateTime column …

Databases mssql
Member Avatar for Timothy_3
0
213
Member Avatar for sergio_pb

Hello, I have my database xampp mysql and i put values from visual studio 2012. I have the code for INSERT INTO mytable, but always i insert the value, this value appears like 0. I dont know the reason beacause if i'm conected to the database and i send the …

Databases mysql visual-studio
Member Avatar for sergio_pb
0
320
Member Avatar for engrjd91

Hello everyone. I have 4 tables whose Structures are provided with my question as snapshots Table 1--> Students Table 2--> Courses Table 3--> Student_Courses Table 4--> Users I want 3 columns in the output which are. 1- Course 2- Classes Attempt 3- Classes Missed Now : --Only those courses should …

Databases mysql
Member Avatar for diafol
0
201
Member Avatar for engrjd91

I have the following code.. echo "<table align='center' border='1': bordercolor='silver'>"; echo "<tr>"; echo "<td align='center' width='200'>" . "<h4> "."Course" . " " . "</td>"; //echo "<td>" . " " ."</td>"; echo "<td align='center' width='200'>" . "<h4> "."Classes Attended" . " " . "</td>"; //echo "<td>" . " " ."</td>"; echo …

Databases
Member Avatar for JorgeM
0
162
Member Avatar for J.C. SolvoTerra

Hey guys. I'm writing myself an online toolbox (for my code snippets). I have a "Snippets" table. My question is this. Would you save the snippet source in a Text column or would you have the snippet saved to a text file and the Snippet entry would reference the file …

Databases mysql
Member Avatar for diafol
0
229
Member Avatar for usha_bandela

Hi.. I'm getting error in my query.. while using it in oracle it is working.. But when using it in mysql it is not working.. i'm getting error as insert into ProjectHealthReportAudit(clientid, projectid, month, year, phasesId,ACTIVITIESSUBTYPEID, ACTIVITIESARTIFACTSID,processConformance,comments, pcinumber, pciscore, colour, createddate,createdby) values ( (select clientid from client where clientName = …

Databases mysql oracle
Member Avatar for usha_bandela
0
1K

The End.