Archive for the ‘Internet’ Category

Feb
11/10
Mysql – php searching two strings
Last Updated on Thursday, 11 February 2010 07:44
Written by Reko Srowako
Thursday, February 11th, 2010

Hi all. I’m stuck on a problem involving php and mysql. I think it’s a mysql problem. In short, I have a form with two text fields where a user is able to enter the string which they would like to search. It searches the fields authors, paper title and journal title named respectively as “authors”, “paper” and “journal” in mysql. I have a bunch of “if” statements in my php script that will add relevant commands to my sql query (that is $sql = select * from journals where true etc..).

Now, if I enter a word in only one of the search boxes then it will work. However if I type into both boxes, it will only search the word that is in the first search box. The query for when a word is typed into both fields is

SELECT * FROM journals WHERE TRUE AND authors LIKE ‘%text%’ OR paper LIKE ‘%text%’ OR journal LIKE ‘%text%’ AND authors LIKE ‘%text2%’ OR paper LIKE ‘%text2%’ OR journal LIKE ‘%text2%’

The code when inserted into mysql seems to stop before the second AND. Can only one AND be used in mysql? I also typed the command in the mysql window and got the same result as I did through the php script so I’m pretty sure its something wrong with the command.

So is it possible to search two strings through mysql through multiple fields? I tried a MATCH command but it didn’t work (maybe I had used it wrongly though).

Any help is appreciated. Thank you in advance.

Possibly Related Posts:


Posted under Internet, Tips  |  Comments  137 Comments
Aug
31/09
Your Ideal Partner Online – Cheap Web Hosting
Last Updated on Monday, 31 August 2009 04:06
Written by Reko Srowako
Monday, August 31st, 2009

web-hosting-seoThe contest web hosting is increasing rapidly in the Internet world today. While some are willing to spend more money in hosting a website, others are on a tight budget. The obligation to respond to those facing financial constraint entailing cheap web hosting. Although it is cheap, it does not necessarily mean they are inferior. Services could be sufficient to manage a small or medium enterprise.

Usually a cheap web hosting offer storage space of 100MB giving you enough room to place banners on your site. Regarding the email account, you will be provided until seven email accounts specified under that particular host. The given bandwidth will be 1 GB, which is acceptable. Ready made templates are also provided for you to build your website.

Now, in all things, there are advantages and disadvantages and cheap web hosting is no exception. A negative side of cheap accommodation is not to have your own domain. Instead, you will be placed in a sub-domain. In fact, if you use a free hosting service, there will not even function e-mail for you. Imagine not having your own domain and email …! It would certainly reflect on the lack of professionalism. Besides that, you also have no access to databases. This means that you can not download files when you want that is really a problem at your end. link“>(more…)

Possibly Related Posts: