You need to write your query dynamically. When you search for '%blue widgets%' you search for any record where the exact string 'blue widgets' apears, not for the individual words.
$search = 'blue widgets';
// spit the words into an array
$keywords = split(' ', $search);
$sql = 'SELECT text...
No, not hard at all. use function_exists to check if the function exists and if it doesn't (it doesn't in your case) define it yourself as in:
if (!function_exists('checkdnsrr') {
function checkdnsrr($host, $type='') {
// Use one of the implementations on the php.net
// checkdnsrr...
Assuming from your query that you're trying to get the number of pictures for each category, this is what I would try:
SELECT c.*, COUNT (p.PIC_ID) AS PIC_COUNT
FROM PHOTOCATEGORIES c
LEFT JOIN PHOTOPICTURES p ON p.PIC_CAT = c.CAT_ID
GROUP BY c.CAT_ID
Hope this helps,
Brommrrrr
Hmm well I'm not sure about your DB setup (or about my solution really :-)) but I'd try something like:
SELECT *
FROM Object O
LEFT JOIN Booking B ON (B.ObjectName = O.Name AND (B.startDate >= ? AND B.startDate < ? OR B.stopDate > ? AND B.stopDate <= ? OR B.startDate <= ? AND B.stopDate >= ?))...
Hmmm that's a bit much, there's more convenient way:
SELECT TO_DAYS(end) - TO_DAYS(start) FROM table
That gives the number of days without any need for scripting
Cheers,
Bromrrrr
Try looking at the query that gets passed to MySQL. If you try to insert empty values (as in INSERT INTO table (field1, field2) VALUES ('', '') )then MySQL won't return an error but it won't insert anything either.
Hope this helps,
Bromrrrr
It won't work, nested queries and MySQL don't mix :-(.
From the MySQL manual:
The following will not yet work in MySQL:
SELECT * FROM table1 WHERE id IN (SELECT id FROM table2);
SELECT * FROM table1 WHERE id NOT IN (SELECT id FROM table2);
SELECT * FROM table1 WHERE NOT EXISTS (SELECT id...
Try:
CREATE TABLE #url.JobId#
(id INTEGER PRIMARY KEY AUTO_INCREMENT, email VARCHAR(30) NOT NULL , SectionNumber INTEGER, INDEX(email))
This should do it all in one query....
Hope this helps,
Brommrrrr
Ehrm....no offence, but first of all I would suggest you do some reading!. This shouldn't be a problem, especially for someone who 'knows' php.
your $result gives back a resource id because it is in fact a resource id, read the php documentation on how to use it. Someone who 'knows' php should...
This error usually occurs when you have some sort of error in your SQL. From reading your post I gathered (excuse me if I'm wrong :-)) that you have two fields in your table named "securitylogin" and "securitypassword" but in your SQL you're trying to access them as...
Mind you, I'm not really sure on this one and I have no way of testing it at the moment, but I'd try something like:
<CFSET Tmp="Form.act_pay_" & id>
#Evaluate(tmp)#
I'm not sure I've got it exactly right, but it should work using the evaluate function.
Hope this helps,
Brommrrrr
You could use cftry/cfcatch like:
<CFTRY>
<CFQUERY NAME="MyQRY" DATASOURCE="MyDSN">
*insert query that might go wrong*
</CFQUERY>
<CFCATCH TYPE="database">
*insert error handling*
</CFCATCH>
</CFTRY>
In the cfcatch tag you can redirect users to a general...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.