Click here to Skip to main content
15,881,715 members
Everything / Database Development / MySQL

MySQL

MySQL

Great Reads

by Christoph Buenger
Describes PHP application development with the free Scavix Web Development Framework (Scavix-WDF).
by vic_ch2000
A nullable datetime column in .NET DataGrid with DateTimePicker.
by Peter Leow
Get your database to generate unique running IDs for your application
by SarmadAsghar
Building on My SQL Storage Engines and APIs to Conduct Complex Analysis Using SQL Query Language: Part 5

Latest Articles

by Zijian
Reusable codes for JWT security in business applications
by Frédéric -lefred- Descamps
How to install WordPress on Oracle Cloud Infrastructure (OCI) using always free tier
by Ștefan-Mihai MOGA
About the IntelliDisk app that uses many components published on CodeProject

All Articles

Sort by Score

MySQL 

31 Oct 2014 by Christoph Buenger
Describes PHP application development with the free Scavix Web Development Framework (Scavix-WDF).
17 Aug 2009 by vic_ch2000
A nullable datetime column in .NET DataGrid with DateTimePicker.
2 Sep 2015 by Peter Leow
Get your database to generate unique running IDs for your application
11 Jan 2015 by SarmadAsghar
Building on My SQL Storage Engines and APIs to Conduct Complex Analysis Using SQL Query Language: Part 5
4 Apr 2021 by Yuancai (Charlie) Ye
Continuous SQL-stream Sending and Processing System
19 Feb 2015 by DrABELL
Technique to extend capability of standard SQL by adding the Aggregate Product Function
18 Mar 2019 by Martin Vorbrodt
SQL database access
28 Jan 2015 by Sujith Karivelil
In Master - Slave replication, Changes in master will reflect in Slave. but any changes made in the slave Database will not reflect back in Master, this article will help you to implement Bidirectional Replication.
6 Jul 2022 by DiponRoy
Quick start example to run DB and clients in docker
9 Oct 2014 by Suvendu Shekhar Giri
Sort the result set as per your need
27 Jan 2015 by Vaclav Naydenov
Comparing the performance of two similar CRUD server apps, one written in Python and SQLAlchemy, the other in C++ and YB.ORM.
24 Nov 2017 by Renz Ladroma
How to Setup Master-Slave Replication in MySQL using CentOS
20 Mar 2023 by Bogdan Marian
Ensure your Docker Compose services start in the correct order
22 Dec 2011 by Uday P.Singh
Try this:An ASP.NET Application Using a MySQL Database[^]hope it helps :)
19 Jun 2015 by Emiliano Musso
Geolocalize a device and store coordinates on webserver
8 Oct 2015 by Anele 'Mashy' Mbanga
A look at a flexible Java MySQL CRUD PHP script generator
12 Jan 2011 by Ashy-G
hi,I am having the following problem. I have created an object and I populate the object with values from my MySql database. Each object in added to a list(collection). I then databind this list of objects to the itemsource of a datagrid. I make use of an objectdataprovider. My problem is...
4 Oct 2011 by E.F. Nijboer
You could use LIKE for that. Try something like this query:T-SQL:SELECT Name FROM Employees WHERE Name LIKE '[A-E]%'MySQL:SELECT Name FROM Employees WHERE Name REGEXP '^[A-E].*$'Good luck!
22 Dec 2011 by Wendelius
Few links to start with:- A Step-by-Step Guide To Using MySQL with ASP.NET - Part 1[^]- Using MySQL with ASP.NET - Part 1 [^]And the list continues at here[^]
25 Apr 2012 by Prasad_Kulkarni
Please refer following threads:Beginner SQL Tutorial[^]SQL Server Indexes [^]SQL Server Index Basics[^]Introduction to Indexes in SQL Server[^]A Guide to SQL Server Indexes[^][EDIT]This CP Article will clear all your doubts:Defining Indexes with SQL Server 2005[^]Some...
8 Aug 2013 by adriancs
Silverlight access to MySQL using Web Services.
22 Sep 2022 by Member 4206974
CrossData is a PHP object for creating an HTML table or a PHP array, crossing two fields of a table from a PDO accessed database.
13 Dec 2015 by Nazar.Bukhari
This tutorial will demonstrate the creation of second mysql instance and transfer a database from the first instance to the second.
7 Dec 2022 by adriancs
Accelerate the Development with MySQL in C#
U 17 Apr 2024 by Zijian
Reusable codes for JWT security in business applications
24 Mar 2010 by Christian Graus
Don;'t use a string, use a datetime. Then there's no room for parsing errors.
5 Jan 2011 by Hiren solanki
Following query what you've written will cause error you stated definately because you are getting more then one linenamet from linet, That is 3 for you example.update line set LineName = (select linenamet from linet);For that you can modify your query like.update line set LineName =...
11 Mar 2011 by OriginalGriff
You can't test against System.DBNull - that's a class. Either use System.DBNull.Value, or try this:object o = ds3.Tables["tempEmpDetails"].Rows[0]["Emp_Photo"];if (o is System.DBNull)) { pictureBox2.Image = Properties.Resources.profile; }else { Byte[] byteBLOBData...
14 Mar 2011 by Sergey Alexandrovich Kryukov
The way is using the brute force, which is a relatively simple problem. The problem is NP-complete, http://en.wikipedia.org/wiki/NP-complete[^], so you'll have a big extremely rapidly growing trouble when the input data set grows.The problem should be used operating on graphs, see...
9 May 2011 by OriginalGriff
How many people do you think have access to the web server? It's more than you think...Where on the server did you put the file?What are the access permissions on the file? On the Folder?Never store passwords in clear: it is always a security risk.There is some info (c# code, but the...
10 May 2011 by Richard MacCutchan
I wonder how many times this has to be explained to you in this and your previous question[^] before you understand? The SELECT command does not return a value giving the answer to your query, it returns a value telling you how many database rows it found. You then need to interpret the contents...
3 Aug 2011 by «_Superman_»
That is why its good to indent code.Then you will know exactly where one open open bracket ends.If you're using Visual Studio you can try this -Select the code that you want to indent.Select Edit -> Advanced -> Format Selection.
8 Feb 2012 by ebrahim amini sharifi
Sending and receiving message, user authentication, user permission, priority message
13 Jun 2012 by Stephen Hewison
The reason your second query is not showing a true result is because you're joining the tables without any kind on link. That means that the counts will be multiplied by the other tables. test * usertesting * user1.So if you had the following tables:TableA, TableB, TableC1 6 ...
27 Jul 2012 by abhinavvijay
1. Cursor declaration: To declare a cursor you must use the DECLARE statement.Syntax:DECLARE cursor_name cursor for select_statement; If you want to use the multiple cursor then the cursor name must have an unique name and each cursor have specified block. 2. Cursor open...
14 Feb 2015 by BD Star
Create-Read-Update-Delete(CRUD) operation by MySQLi procedural way in the PHP
7 May 2015 by Mr. xieguigang 谢桂纲
You see, this small utility tool save much of your time, this is another happy day! I hope you can enjoyed this code.
7 Sep 2015 by Sergey Alexandrovich Kryukov
Strictly speaking, the choice of the database engine has nothing to do with MVC or any other framework on top of ASP.NET. It's enough that it worked well with ADO.NET. This choice should take into account the requirements of your application, which you did not share with us. But please don't do...
14 Dec 2015 by OriginalGriff
An SQL INSERT query doesn't look like that. It looks likeINSERT INTO MyTable (NameOfMyColumn1, NameOfMyColum2) VALUES (ValueForMyColumn1, ValueForMyColumn2)
15 Apr 2016 by Richard Deeming
The problem is that you are using string concatenation to build your queries. That leaves your code vulnerable to SQL Injection[^].You need to change your code to use parameterized queries instead. That means switching from the mysql_ methods to either MySQLi[^] or PDO[^].This SO...
29 Apr 2016 by CHill60
In addition to the solution from digimanus above also consider using Stored Procedures - MySQL :: MySQL Connector/Net Developer Guide :: 4.1.5 Working with Stored Procedures[^]. You would still pass parameters.See this article for an example Working C# code for MySql Stored Procedures IN,...
7 Jun 2017 by Peter_in_2780
The "unexpected end of file" error usually means you have a php block unterminated. The parser reads off the end of the file searching for block termination, usually }. In your case, the } right before your second
3 Dec 2018 by Han Bo Sun
In this tutorial, I will introduce the use of Spring JdbcTemplate in a Spring Boot web application. This tutorial will show how to create the necessary configuration for JdbcTemplate. And how it can be used for data insertion and retrieval.
4 Apr 2020 by Arthur V. Ratz
Introducing NLP-Samurai@0.0.10 Natural Language Processing Engine.
31 May 2019 by Arthur V. Ratz
The readers of this article will find out how to use Clarifai API for Node.js to create and deploy a lightweight vehicles images classification web-application.
8 Jan 2020 by Wendelius
Since you're using an aggregate you need to give an alias to the column if you want to reference it by name. For example Statement s = con.createStatement(); ResultSet rs = s.executeQuery("select Max(CarNumber) AS MaxCarNo from CarRegistration"); rs.next(); rs.getString("MaxCarNo"); if...
22 Aug 2017 by JUST_Neeraj
A Simple Messaging\ Workflow \ETL system on MySQL and .NET
31 Mar 2010 by Sandeep Mewara
You need to specify file name and then first read it's content in a string and then execute CommandText command. PS: this will work as long you don't have GO statement in your sql script. Since SQL Server 2005, one can use smo library to do this operation and not use batch command and...
4 May 2010 by Chris Meech
The main difference between the two is that a function provides the ability to RETURN a value when it is completed, while a stored procedure does not. However stored procedures will usually populate tables with data, or 'return' values in out parameters. :)
29 Nov 2010 by wizardzz
It looks like you are recreating the file within the loop, so your line:System.IO.StreamWriter file= new System.IO.StreamWriter("example.txt");file.WriteLine(result);Is overwriting the file every time.According to StreamWriter documentation:If the file exists, it is overwritten;...
13 Jan 2011 by Nish Nishant
One popular approach is that the client that inserts/updates the database will broadcast a db-updated message that's received by all other active clients. The message can directly provide the inserted or updated data, or the clients can choose to do a db-refresh to get the changes (this is a...
18 Jan 2011 by Prerak Patel
Try this - SELECT *FROM yourtableWHERE @time between st_date AND end_date
31 Jan 2011 by Henry Minute
Storing Images in MySQL using ASP.NET[^] might get you started.
25 Apr 2011 by Wayne Gaylard
I prefer to use MySQL Connector/Net which can be downloaded Here[^]. There are also good tutorials on the MySQL site Here[^]Hope this helps
12 May 2011 by Richard MacCutchan
I think you need to spend more time studying your programming guides and less time posting the same basic question over and over again.
12 May 2011 by OriginalGriff
I am getting serious deja vu here: we have been here before!SELECT COUNT(*) FROM...Returns a dataset containing one row. Always. That row, has one column. Always.The single cell in the entire dataset contains the number of matching rows in the database.This could be 0, 1, or any other...
14 May 2011 by OriginalGriff
I take it the complaint is here? if (RED[i] == 1)If so, then it makes sense: the type of RED[i] will be char* - try comparing it with "1" instead. if (RED[i] == "1")[edit]Way too much C#! :laugh:Try parsing RED[i] to an int and comparing that...[/edit]
22 May 2011 by lvq684
Hi.I guess this is a very simple question, but I really can't find the answer that suits my needs!What I have is 2 tables in a MySQL database:Families- FamilyId- City- PhoneMembers- FamilyId- BirtdateThe family id is of course the primary key, that binds members to...
21 May 2011 by Kim Togo
As you execute the query "SELECT * FROM `Families`, `Members` WHERE `Families`.`FamilyId`='123' AND `Members`.`FamilyId`='123'" You join the to tables Families and Members into 1 result set.The output result will beFamilyId,City,Phone,FamilyId,BirtdateEnding up with 5 column on each...
22 May 2011 by Sandeep Mewara
Create a class library - BusinessLogicCreate a class library - DataAccessNow, from your UI, use the object model and pass on to BusinessLogic project class. This class is a Business logic class. Do the changes as per your need here.Now, pass on the changed data from business logic class...
30 May 2011 by R. Giskard Reventlov
You need to have a mechanism that allows for this: something like if the power cuts off a user needs to have the ability to reset their own log in. How you set the rules for this is down to your requirements but there has to be a little trust or you need to have a central administrator or help...
13 Jun 2011 by Ger Hayden
Route 1 is defined as with the following stages on my RouteStage tableStage ID SequenceNumber1---------------17---------------23---------------35---------------4Passenger X travels from along Route 1 from Stage 1 to Stage 3Then my mythical user decides to delete Stage 7But I...
14 Jun 2011 by Amit Kumar Tiwari
AFAIK, for single insert there can be only one insert statement. Single insert statement cannot insert in two tables, however, you can create an insert Trigger on Signup table for login table.So when the data is inserted in Signup table, it will automatically fire insert in login table.
16 Jun 2011 by #realJSOP
It means the column you're trying to use/retrieve doesn't exist in the table.
5 Jul 2011 by OriginalGriff
Oops.Unles...
17 Aug 2011 by Milind R Chavan
Create MySQL Database backup using mysqldump
2 Sep 2011 by Wendelius
This looks like a bad design. Instead of having years and values as separate columns, you should use a table with two columns:- Year- ValueSo the data in the table would be:Year Value---- -----2010 1552011 1192012 145With that, you would query for proper year always from...
22 Sep 2011 by smoore4
Loop through all files in a folder/subfolders and run a checksum that is stored in a database. E-mail descrepancies and results.
29 Nov 2011 by RaisKazi
Have a look at below link for information on "Object-relational mapping".http://en.wikipedia.org/wiki/Object-relational_mappingBelow are some of the ORM based Technologies/Techniques compatible with .Net.NHibernateEntity FrameworkQuote:1. Why we need to create classes for...
17 Jan 2012 by OriginalGriff
A course, or a book are the best ways - they structure the learning so that you pick up what you need as you need it, and should not miss out too much of the important basics on the way. Do the exercises as you go - they are important to reinforce what you have learnt. Learning as you go in an...
31 Jan 2012 by Espen Harlinn
Have a look at: http://dev.mysql.com/doc/refman/5.6/en/account-activity-auditing.html[^]http://fromdual.com/mysql-logon-and-logoff-trigger-for-auditing[^]For general auditing you can try working with the logs:http://dev.mysql.com/doc/refman/5.6/en/server-logs.html[^] - While I...
10 May 2012 by OriginalGriff
Try this:SELECT * FROM myTable WHERE myField LIKE '[0123456789]%'The [0123456789] part says "any character in this set" and the % matches any text at all.
16 May 2012 by Wendelius
Crystal should support the DateDiff function so you could try to set up the formula likeDateDiff ("h", {Time_in}, {Time_out})
24 Jun 2012 by OriginalGriff
Just a guess, but have a look in the registry - if you do a search for the folder name in regedit that will probably find the problem.
5 Jul 2012 by OriginalGriff
Try closing down windows and restarting it. Then open VS, and clean your solution before doing a full rebuild. If that doesn't solve it, then we would need a lot better info than you have given! :laugh:[edit]Yay! I just realised - this is the first QA answer I have given that is basically...
10 Jul 2012 by OriginalGriff
Try:SELECT * FROM myTable WHERE name='Name' AND userId='UserId'Just do it with a parametrized query:using (SqlConnection con = new SqlConnection(strConnect)) { con.Open(); using (SqlCommand cmd = new SqlCommand("SELECT iD, description FROM myTable WHERE userName=@UN AND...
11 Jul 2012 by OriginalGriff
Null is an absence of a value, so Not Null is the absence of the absence of a value.I.e. if there is no value, it it Null.If there is any value, it is Not Null.Null should not be confused with zero, or naught, as that is a value. Null is a special condition which is outside the range...
13 Aug 2012 by Christian Graus
select top 1 myfield from tblItemImagePaths where ... ORDER BY fldItemSize DESCis one obvious way to go.select myfield from tblITemImagePaths where .... AND fldItemSize = MAX(fldItemSize)is another.
20 Sep 2012 by enhzflep
As per the request from Sourav, I've reposted my comments as a solution.A couple of points that come to mind■ You could download phpBB (free forum software) and look at the source■ When uploading files, it (a) renames them (b) keeps track of the original name and the renamed name■...
4 Oct 2012 by Sandip.Nascar
Check your database and see, if you really have any records for the filter criteria you set. From the query, it is clear that you have all the filter fields as varchar, so the query seems okay.Some optimization point,You better use parameterized query. This is not a must requirement but...
12 Oct 2012 by jotorres
For those of you who do not know how to create an insert using PHP and MySQL, here I will teach you.
30 Nov 2012 by __TR__
Quote:i want to update the column locked value as 1 where Aid=xx (tableA)UPDATE tableASET locked = 1WHERE Aid = [some value]Quote:in tableBall Aid column with matching value xx then locked value as 1 UPDATE tableb, tableaSET tableb.Locked = 1WHERE tablea.Aid = tableb.Aid...
2 Dec 2012 by __TR__
Try using ROW_COUNT()[^]
22 Dec 2012 by __TR__
TrySELECT P.Id, P.Name, P.Amount FROM person PINNER JOIN ( SELECT Min(Id) AS Id, Name FROM person GROUP BY Name) T ON P.Id = T.Id
23 Jan 2013 by Azziet
check this thread in Code Project Dynamically adding and deleting rows from ASP.NET GridView[^]
10 Apr 2013 by Sudhakar Shinde
Please find below steps to store and retrieve hindi text.1) Choose utf8 character set and utf8_general_ci collation.2) Whenever you want to save and retrieve the data you need to set the characterset as follows.//To set the char setmysql_set_charset('utf8');//To select hindi...
16 Apr 2013 by Maciej Los
Try this:SELECT refer_id, COUNT(refer_id) AS CountOfReferIdFROM YourTableGROUP BY refer_idORDER BY refer_idMore about: Aggregate functions - MySQL 5.0 Reference[^]MySQL aggregate functions[^]To get refer_id's where COUNT(refer_id)>=4SELECT refer_id, COUNT(refer_id)FROM...
5 May 2013 by Sergey Alexandrovich Kryukov
Decide if it should be Java or PHP or something else, read about Web scraping using one of these technologies. See also:http://en.wikipedia.org/wiki/Web_scraping[^].[EDIT]More exactly, learn to send HTTP request and receive HTTP response. Please...
8 May 2013 by _debasis
In while loop while( $data=mysql_fetch_array($result)){ echo $data[0].$data[1].$data[2].$data[3]}what it does? It just looping through the $result.So it give you the result as row1 row2 .....But when you echo it with out the while loop it prints the first row .And echo it again it...
24 Jul 2013 by Prasad Khandekar
Hello,Following code snippet which is based on one of sample database project provided with QT should get you started.QSqlQuery query;query.prepare("INSERT INTO t(user_name) VALUES(?)");query.addBindValue(strUserName);query.exec();You can find some really good examples in Qt...
24 Sep 2013 by Member 7918016
Portable version of MySQL database is here...http://www.mediafire.com/...Portable.Mysql.5.5.13-Very.Small.rar[^]
14 Oct 2013 by bjdestiny
I also faced this issue and this is how I solved. 1. Make sure xampp is not under sub-directory. For example, it should be C:\xampp 2. You might need to run as administrator in running the application.Hope this will work! If it is not working then check that You already have a version of...
7 Apr 2014 by subhajit bhadury
nKnight - RBAC Solution for C#.NET
9 Jul 2014 by Jason Parms
Lightweight Directory Access Protocol (LDAP) Injection
22 Jul 2014 by Rocky R. Fernandes
Install Rails 4 and MySQL Server on Windows 7/8
12 Aug 2014 by Dilan Shaminda
You can have multiple queries inside a single MySQL stored procedureDELIMITER $$CREATE PROCEDURE procedureName()BEGIN -- Query 1 -- Query 2 -- Query 3END $$DELIMITER ;
9 Aug 2015 by Maciej Los
In addition to solution 1 by Advy Pandya[^], i'd suggest to read this: Visual Representation of SQL Joins[^]
18 Sep 2015 by Kurt Friedrich
I wanted to use MySQL as the database to hold code first models with ASP MVC.
2 Dec 2015 by phil.o
Granting rights on a database is done via a SQL script.So, the first thing you have to do is to get the correct syntax.You can find how to do that on MySQL 5.7 Reference Manual / ... / GRANT Syntax[^].Then you have to get how to execute a MySQL query from a .NET assembly.You will...
29 Apr 2016 by Herman<T>.Instance
I'll show you 1 example. The rest you should be able to do yourself:Your query:string sel="SELECT u.Id as ID,u.Name,u.IName,s.FId,s.TId,s.data,s.Date,s.ID as Id,s.iurl,s.Id as SpId,s.ITitle FROM mydb.userdb as u, mydb.psp as s WHERE u.Id=s.FId AND s.FId='" + Session["UId"].ToString() +...