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?
...
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...
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...
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...
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?
...
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 ...
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?
where ((location/'$location'<2) and (location/'$location'>=1))
...
Could anyone give me examples of how to use parameterized queries with MySQL/PHP please?
...
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...
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...
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...
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!
...
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...
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...
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...
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...
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;
...
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...
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...