mysql

zend search engine, need some guidance in the right direction please

I have been looking at manuals of the Zend search engine, but I don't really understand much of it. I have a php website (classifieds) and I want users to be able to search my mysql database for records. Can someone explain a little more about the Zend search engine, and how I should actually 'install' it. I don't have my own server (h...

What should I do, create a search engine myself or use another one?

I have this classifieds website and I have now been searching for ways to implement a search function of the classifieds. I wonder, is there any tutorial for creating a pretty powerful search engine in PHP that you know of? I have looked into third party search engines, and it feels they are too much... PS: No full-text support on my ...

Ok, last question regarding search engine on my website...

I have read the intro to the zend manual, and as far as I understand I have to install the framework on my server... And my webhosting provider says they don't support that, so it's not possible... It must be installed in order for me to use it and implement a search function of my mysql records, right? Thanks ...

Multiple MySQL queries and how to make my script go faster

Hello to all. Using PHP (1900 secs time limit and more than 1GB memory limit) and MySQL (using PEAR::MDB2) on this one... I am trying to create a search engine that will load data from site feeds in a mysql database. Some sites have rather big feeds with lots of data in them (for example more than 80.000 records in just one file). Some...

MySQL and UTF-8

In MySQL, what is the difference between doing: SET NAMES 'utf8' And: SET CHARACTER SET 'utf8' I've taken a look at Connection Character Sets and Collations MySQL documentation page but I'm still a bit confused... Do both commands need to be issued in order to make MySQL UTF-8 aware? Or is SET NAMES enough? ...

MySQL: Who are today "on" between 2 diferent dates

I have a Mysql problem. (I use PHP with it). For example I have this kind of database: Name | Started and | will end Jason | 2009-12-17 | 2009-12-24 Ericke | 2009-12-12 | 2009-12-30 Maria | 2010-01-02 | 2010-01-10 With mysql (or php) question I would like to get the names of people, which are "on" right now (2009-12-19). The answer...

Can I constraint an AutoIncremented column not to accept values from outside?

I have an AutoIncremented column (ID), and I want to have a constraint that only the database ever fills in this column. Is there a constraint for that? ...

Disallow inserting text values into integer columns

I accidentally tried to insert 'asdf' into an integer column. It worked (put 0 in the column), and gave this warning: Incorrect integer value: 'asdf' for column 'Author' at row 1 How can I cause similar insertions to fail instead of merely issuing a warning? ...

Rearrange column order in Sqlyog

Is it possible to rearrange a table's column order in SQL yog? ...

Embarassingly easy SQL question(s)

I am trying to write what should ostensibly, be relative easy SQL queries - yet, I cant seeem to get them to work. Is it possible to write a query that looks something like this: select t.name from (select * from mystoredproc(1,2,3) as t) where t.name = 'foobar' Two problems with the above query: 1) First off all, th...

Export Table Into Files Grouping By A Column

Hi! I have a MySQL table that needs to be exported into several separate files. The table should be grouped by a particular column and files should have names of the corresponding values of this column. Format is not relevant I just need a suitable technique, program, whatever. Any help would be much appreciated! ...

MySQL Query puzzle

I have a table with two fields (id and word). Can anyone enlighten me as to why: $query0 = "SELECT * FROM words WHERE id IN ($treated_words) "; is a valid query. But: $query0 = "SELECT * FROM words ORDER BY id ASC WHERE id IN ($treated_words) "; is not. Many thanks ...

Return only unique table id's from MySQL join

I have a MySQL database with two tables (simplified for this question): movies table columns: id, title, duration, description, created_at, updated_at rentals table columns: id, movie_id, status, created_at, updated_at The rental status is either 'CHECKED OUT' or 'RETURNED', so a movie is available if it either has no associated rental,...

how to test date and datetime with mysql

hi guys, My table is using a datetime (YYYY-MM-DD HH:MM:SS) and i need to display today's entries. my code is only : SELECT * FROM table WHERE date = '$date' ORDER BY score DESC with $date = date("Y-m-d"); well, as expected it doesnt work :| you guys have a solution here ? ...

Retrieve Database Value Without Page Load AJAX/PHP/Facebook Style

Hi all, I am wondering if anyone could show, or explain with examples, how facebook checks its database for new messages? It seems to do it periodically, without loading the page. What would be the best way to achieve this in a PHP/MySQL/Jquery script? Any help is always appreciated! Cheers, Lea ...

How to update a web page without reloading the web page using AJAX?

I'm trying to update info that a users entered in to a mysql database using php without reloading the web page how can I do this an example or tutorials will be nice. If there is a tutorial on how to do this can you please share with me the link or links to the tutorial(s). ...

is it invalid to set a reference to null or 0?

I'll be doing this in sqlite now that they support foreign keys and tsql and perhaps mysql. Is it illegal to do something like CREATE TABLE comment( id integer primary key, parent integer references(comment.id), author integer references(User.id), desc varchar(max), hidden bit deleted bit ); where parent may be 0 or null because it ...

MySQL - counting with HABTM relationships

I have 3 tables: 'cards', 'tags' and 'cardstags', where cards HABTM tags Question: What query do I execute on the 'tags' table to count the number of associated 'cards' rows? I'm looking for something like this: tags.name | count ----------+------ cricket | 15 (15 cards are tagged as 'cricket') soccer | 23 football | ...

What's wrong with my MySQL statement?

UPDATE table1 SET announcer = ( SELECT memberid FROM ( table1 JOIN users ON table2.username = table1.announcer ) AS a WHERE a.username = table1.announcer ) #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'a where a.username=table1.a...

How to write this MySQL update statement?

How to write this MySQL update statement: table1 identity table2 memberid, username, email Some values in identity of table1 are email, some are username, how to replace the values in identity of table1 with the corresponding value of memberid of table2? ...