barbatruc
-
Posts
28 -
Joined
-
Last visited
Never
Posts posted by barbatruc
-
-
How do you proceed for your Insert queries ?
You should have something like:
INSERT INTO `table` (`field`) VALUES (\'5\');
If `field` is a decimal field and has a length of 10,2 this will insert value 5.00 into the database. In MySQL, even if you place values between \', values will be converted to the right format. Also, be sure to use the \".\", not the \",\" to separate the decimal part from the integer part.
JP.
search?
in MySQL Help
Posted
You can use the LIKE command first to get in touch with MySQL queries. You could have something like:
(suppose search keywords are posted into $_POST[\'search\'])
(ensure $keywords is not empty!)
This query will return you all articles where the title or the content match keywords you can find in $_POST[\'search\']. Suppose you submitted \"jupiter moons\", this will generate SQL query:
Character \"%\" is used as a wildcard for 1 or several characters. So if the title of an article is \"What the the names of jupiter moons\", this article will be matched. With the MySQL LIKE command, character \"_\" can be used as a single character wildcard.
Ref: http://www.mysql.com/doc/en/String_compari..._functions.html
For advanced search queries in medium or big tables, you should take a look at the MATCH command because this command is really intended to ease the job of the programmer when building a simple search engine:
Ref: http://www.mysql.com/doc/en/Fulltext_Search.html
JP.