Lets say I have a table in MySQL called articles, that has a column called article_id. I also have another table called links which have two columns called article_id and link.
Every article can have multiple links attached, let's say that article_id=2 have two links:
articles:
article_id | text
-----------+------
2 | blah
li...
Consider this scenario, my database table has 300000 rows and has a fulltext index. Whenever a search is done it locks the database and doesn't allow anyone else to login to the portal.
Any advice on how to get things sorted out here will be really appreciable.
...
Is there a way to insert a dynamically generated datatable into mysql database in asp.net?
...
i trying to fetch records from database as.
select * from emp_marks where sub_id all(2,4);
...
Normally LIKE statement used to check the pattern like data.
ex:
select * from table1 where name like 'ar%'
My problem is to use one column of table with LIKE statement.
ex:
select * from table1, table2 where table1.x is like table2.y%
Query above creates error creates . how to use one column data in like query?
...
Is it better to close the connection after each query is executed or put the connection as is it, then php will automatically close that connection.
Which one is better and why?
...
Using PDO / PHP and MySQL, how can I check if a record was inserted or updated when I use an INSERT ON DUPLICATE KEY UPDATE statement?
I have seen a solution using mysql_affected_rows() for PHP, but I am looking for a way I can use with PDO.
...
I suspect the answer to this is "No", based purely on the concept of type safety in general, but I shall ask anyway.
If I define a stored function in MySQL, normally part of the CREATE syntax defines the return type of function.
Is it possible to define one where the return type is one of two possible types, depending on the result, bu...
I was curious, in one doc i read it suggest using limit 1 on all queries if available including indexed and unique columns. Does writing limit 1 actually help queries when using a WHERE uniqueCol = val; ?
...
If it's an int, I know it will be faster, just cannot understand the string type.
notes:
most Asian language don't have the space between words. and mysql cannot split the sentence to words. and also, I mean random search, that is, words can appears in any where in a sentence .
...
I was curious since i read it in a doc. Does writing
select * from CONTACTS where id = ‘098’ and name like ‘Tom%’;
speed up the query as oppose to
select * from CONTACTS where name like ‘Tom%’ and id = ‘098’;
The first has an indexed column on the left side. Does it actually speed things up or is it superstition?
Using php and my...
I encountered some curious behavior today and was wondering if it is expected or standard. We are using Hibernate against MySQL5. During the course of coding I forgot to close a transaction, I presume others can relate.
When I finally closed the transaction, ran the code and checked the table, I noticed the following. All the times I...
Maybe I am day-dreaming but I am about to merge the contents of two large tables which represent two companies versions of the same data. I'd like to avoid duplicates (entries with the "title" field from DB 1 being almost the same as the "title" from DB 2. Are there any methods in php or mysql do do close string matches and return a rele...
For my ASP .NET webpage I am using a MySQL database with a TINYINT field to indicate a boolean (0/1) value.
Thanks to stackoverflow I was able to read the field value into a Listview as a asp:Checkbox.
<asp:CheckBox ID="freight_foundCheckbox" runat="server"
Checked='<%# Convert.ToBoolean(Eval("freight_found")) %>' />
What is c...
Hello,
I am trying to search my db for a string. But it should be able to match any word and not the whole phrase.
Suppose table data has text like "a b c d e f g". Then if I search for "d c b" it should be able to show the results.
field LIKE '%d c b%' does not work like that
Can someone suggest a more robust way to search, possible...
I have a MySQL table that records classified listings. We don't force users to join to post a listing, and therefore the listing will not always have a user_id associated with it.
I therefore need a method of recording the poster's email if they are not signed in.
Is it bad practice to create a column email that will sometimes be blank...
I'm trying to add a foreign key to an existing table, and was having issues. I figured that I had an error in my syntax, so I updated my hibernate.cfg.xml file to auto-update.
As it turns out, hibernate had the same error. Here's my SQL to add the foreign key:
alter table pbi add index FKEA3F7BDE9BAB051 (FK_idP), add constraint FKEA3...
Hi,
Which is the best aproach to select * from various tables but with same row name, cause normally i use $row['name'] but i have seven tables with the some name... how can i do this?
tkz
Roberto
...
I'm building a PHP calendar app for a photography group. They need to be able to assign multiple dates/times to a single event.
As of now, I have an Events table and a Slots table (for time slots). Events only has id, title, and description, while Slots has id, start time, end time, and event_id as a foreign key.
I've created an Event ...
I'm having some difficulty with my Entity Framework context that is proving very troublesome to debug. I added a feature to my application yesterday that gave one of my entities an additional collection of child entities (called Models) and after updating one of my expressions to Include() that collection when I query for the parent obje...