mysql

how to search text in threads?

i am coding my first forum and wants to have a search field. i am wondering what function i should use to search for specific threads in database. should i use WHERE title LIKE '%keyword%' OR body LIKE '%keyword%' is that the common search algorithm for thread contents? ...

mySQL SELECT join, group by or something

hi There, I can't get on the right track with this, any help would be appreciated I have one table +---+----------+---------+-----------+ |id | match_id | team_id | player_id | +---+----------+---------+-----------+ | 1 | 9 | 10 | 5 | | 2 | 9 | 10 | 7 | | 3 | 9 | 10 | 9 | | 4...

Mysql - Select, order by times a column value appears in a string

Sorry, I should have explained better: I have a $string and I want 'table' to be ordered by the number of times each value under 'word' column appears in that $string. for that i need a query like: 'SELECT * FROM table WHERE $string LIKE CONCAT("%",LOWER(word),"%")... to find the words, then I would like to order them by appearance s...

How to get pages.path

I have the following two tables. I want to get all from menus table and also path from pages table. I tried it but I am not able to get the pages.path. Can anyone point out my mistakes please. CREATE TABLE IF NOT EXISTS `pages` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL DEFAULT '', `keywords` varchar(2...

how to use solr with mysql and php?

i read about how i could use solr to search in my threads but i dont quite understand how it works and i cant find any articles explaining this for a total beginner. could someone explain briefly how solr works and how it communicate with mysql and php? ...

Is the TransactionScope object fully supported using MySqlConnector for .NET?

I'm writing unit tests (technically integration tests since I am connecting to a database) and I want to create records in a transaction within the test, and rollback all database modifications once the test completes. The idea being that I'll create records through one API call that another API call expects to find in the database. I ...

Subsonic 2.x MySQL CodingHorror

Hi! What’s wrong here? This is how I found on examples of Subsonic 2 CodingHorror and doesn't works :( new CodingHorror().Execute("SELECT * FROM product WHERE IdProduct = @IdProduct", 1); The error I get is “Parameter '@IdProduct' must be defined” I’m using Subsonic 2.x and MySQL! Thank you for your help! :) ...

How to write this meaning in a MySQL query?

How to write this meaning in a MySQL query? where ((location/'$location'<2) and (location/'$location'>=1)) ...

Examples of parameterized queries

Could anyone give me examples of how to use parameterized queries with MySQL/PHP please? ...

mysql_pconnect(): send of 5 bytes failed with errno=32 Broken pipe.

I've been using the same DB abstraction library for years. But today it started writing these Notice (8) messages in my log. The application is working correctly but every time a script connects to the DB the same notice is logged. I cannot think what might have changed. This is happening on my local dev machine. OS X 10.6.2 PHP 5.3.0...

MYSQL vs. PHP SELECT COUNT(*) values differ

Hi, I'm trying to get the total count for a query but MYSQL and PHP return different values. Query: SELECT count(*) as fr FROM (select uemail from associado WHERE utipo=1) AS t1 MYSQL returns 11; PHP returns 10; Is there any reason for that? I've found the following: The missing row is: "[email protected]"; This row is ju...

Subquery to get payments that are due

Hi, I have two tables, one that stores user earnings and another that stores the user payment. What I would like to do is to get payments that are due based on a $50 minimum and only from their last payment. Table (userEarnings) has the following columns id ->autoincrement userid -> unique id for users earn ->the amount of money th...

Persistent MySQL connections in Python

Hello, PHP provides mysql_connect() and mysql_pconnect() which allow creating both temporary and persistent database connections. Is there a similar functionality in Python? The environment on which this will be used is lighttpd server with FastCGI. Thank you! ...

ROW_NUMBER() in MySQL

Is there a nice way in MySQL to replicate the MS SQL Server function ROW_NUMBER()? For example: SELECT col1, col2, ROW_NUMBER() OVER (PARTITION BY col1, col2 ORDER BY col3 DESC) AS intRow FROM Table1 Then I could, for example, add a condition to limit intRow to 1 to get a single row with the highest col3 for each (col1, col...

Complicated query - help NEEDED!

Hi, really hope someone can help me on this one! I have 6 tables: Products prodid Prodequipment prodid equipclassmain equipclassor Equipclasses classid Equipfunctions equipid classid Equipment equipid Workshopequipment workshopid equipid Products – a list of some products Equipment – a list of some equipment Prodequipment – lists...

MySQL Views: Referencing one calculated field (by name) in another calculated field

How can I define a view that has two calculated fields, for instance... ('TableName'.'BlueSquares' + 'TableName'.'RedSquares') AS TotalSquares, ('TableName'.'BlueCirles' + 'TableName'.'RedCircles') AS TotalCircles ... and create a third calculated field that's based on the first two calculated fields, as in... ('ViewName'.'TotalSqu...

how to import mysql tables to SOLR

i can never understand how solr works. it just talks about schema files all the way but how do i import content from the database to it with a painless method? i have tried to figure it out by reading their tutorials but it just mess up my head. its written for the Einsteins out there cause apparently there are a lot of people who als...

driver of my sql?

what will I put in this code, in the braces--> (MySQL} Please help I'm not really good at this Dim connectionString As String = "Driver={MySQL};SERVER=localhost;DATABASE=student; ...

how to fix this error?vb.net

Here is the screen shot of the vb.net: http://www.mypicx.com/12132009/ers/ And here is my code: Dim connectionString As String = "Driver={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=my school;" ' Dim conn As New OdbcConnection(connectionString) conn.Open() Dim da As New OdbcDataAdapter("SELECT IDNUMBER, LA...

My webhosting company say it's impossible to change this MySql configuration... help

I am using FULLTEXT as index in a textfield in mysql. This so that I can do FULLTEXT searches later on. The default value of a FULLTEXT nr of characters is 4. This is changed in this line inside the my.cnf or my.ini file: [mysqld] ft_min_word_len=4 According to my webhosting company (one.com) they don't KNOW the value, AND it's IMP...