[PHP-DB] cannot connect to mysql on windows

2006-02-25 Thread raj
Hello,

I have apache 2 and mysql 4.1 and php5 and am unable to connect to mysql 
database server, and keep getting the following error:

Fatal error: Call to undefined function mysql_connect() in 
D:\backup\test.php on line 10

I have removed the semicolon before the line:

extension=php_mysql.dll

I do have the extension at C:/php/ext/
also,  I even have the server running but no luck.

Please help.

Raj

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: cannot connect to mysql on windows

2006-02-25 Thread El Bekko

raj wrote:

Hello,

I have apache 2 and mysql 4.1 and php5 and am unable to connect to mysql 
database server, and keep getting the following error:


Fatal error: Call to undefined function mysql_connect() in 
D:\backup\test.php on line 10


I have removed the semicolon before the line:

extension=php_mysql.dll

I do have the extension at C:/php/ext/
also,  I even have the server running but no luck.

Please help.

Raj

Does it include MySQL information when phpinfo(); is called?

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Query select value on MAX Date

2006-02-25 Thread Neil Smith [MVP, Digital media]

At 08:47 25/02/2006, you wrote:

MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary=_=_NextPart_001_01C63997.1A6B1B7D
Date: Sat, 25 Feb 2006 08:07:36 +0900
Message-ID: [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
To: 'php-db@lists.php.net'
Subject: FW: [PHP-DB] Query select value on MAX Date

Dear All,

 Sorry, I wrote the wrong result.


You've posted 3x with different results so it's too confusing to work 
out what you *want* to get.


However I woudl write that query like so :

SELECT MAX(Date) as NewestDate, Value
FROM table
GROUP BY Category
HAVING Date=NewestDate

HTH
Cheers - Neil

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Writing to a file

2006-02-25 Thread Ron Piggott (PHP)
I wonder if someone would tell me the command in PHP that allows me to
write to a file --- for example test.txt  Just for this example I
would like the word apple to be the contents of test.txt

Now if I want to re-create test.txt --- erasing all the contents and
start over and this time have the word orange in it how would you do
this?  

What commands do you use?

Thanks for your help.

Ron

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Writing to a file

2006-02-25 Thread Bastien Koert

www.php.net/fwrite

bastien



From: Ron Piggott (PHP) [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: PHP DB php-db@lists.php.net
Subject: [PHP-DB] Writing to a file
Date: Sat, 25 Feb 2006 21:42:25 -0500

I wonder if someone would tell me the command in PHP that allows me to
write to a file --- for example test.txt  Just for this example I
would like the word apple to be the contents of test.txt

Now if I want to re-create test.txt --- erasing all the contents and
start over and this time have the word orange in it how would you do
this?

What commands do you use?

Thanks for your help.

Ron

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Help Needed with malfunctioning query

2006-02-25 Thread Chris Payne
Hi there everyone,
 
This line of code USED TO WORK but now it gives me a Coudln't Execute Query
error:
 
$query2 = SELECT word,def,photo MATCH(word,def) AGAINST ('$txtsearchword'
IN BOOLEAN MODE) AS m FROM dictionary WHERE MATCH(word,def) AGAINST
('$txtsearchword' IN BOOLEAN MODE) LIMIT $offset, $item_perpage;

I tried it with a basic $query2 = SELECT * FROM dictionary; to make sure
it wasn't something else that was broke and this is the problem above, it
used to work great and now it's on a live site after working great for 6
months and it suddenly doesn't work and I haven't touched anything !!!  the
server hasn't been updated so it's not that as it also does the same on my
local dev machine here, the only thing that happened was my co-worker did a
global find and replace with dreamweaver but that's all and I can't
personally see anything wrong with the above though I could be looking too
hard.
 
Any help would REALLY be appreciated as this is on a very popular website
and needs fixing ASAP so I don't lose my head !!!
 
Chris


RE: [PHP-DB] Help Needed with malfunctioning query

2006-02-25 Thread Chris Payne
Hi there,

I'm using asd just to test the search, here's the output from the statement
echoed to the screen:

SELECT word,def,photo, if(locate('asd',word),1,2) as meFirst
,MATCH(word,def) AGAINST ('asd' IN BOOLEAN MODE) AS m FROM dictionary WHERE
MATCH(word,def) AGAINST ('asd' IN BOOLEAN MODE) ORDER BY meFirst, word LIMIT
0, 25

Chris

This line of code USED TO WORK but now it gives me a Coudln't Execute 
Query
error:
 
$query2 = SELECT word,def,photo MATCH(word,def) AGAINST 
('$txtsearchword'
IN BOOLEAN MODE) AS m FROM dictionary WHERE MATCH(word,def) AGAINST 
('$txtsearchword' IN BOOLEAN MODE) LIMIT $offset, $item_perpage;

What is the exact error phrase?  Did you echo the $sql statement so you can
see if the variables are correct?


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 268.1.0/269 - Release Date: 2/24/2006

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Help Needed with malfunctioning query

2006-02-25 Thread Murray @ PlanetThoughtful

On 26/02/2006 3:03 PM, Chris Payne wrote:

Hi there everyone,
 
This line of code USED TO WORK but now it gives me a Coudln't Execute Query

error:
 
$query2 = SELECT word,def,photo MATCH(word,def) AGAINST ('$txtsearchword'

IN BOOLEAN MODE) AS m FROM dictionary WHERE MATCH(word,def) AGAINST
('$txtsearchword' IN BOOLEAN MODE) LIMIT $offset, $item_perpage;

I tried it with a basic $query2 = SELECT * FROM dictionary; to make sure
it wasn't something else that was broke and this is the problem above, it
used to work great and now it's on a live site after working great for 6
months and it suddenly doesn't work and I haven't touched anything !!!  the
server hasn't been updated so it's not that as it also does the same on my
local dev machine here, the only thing that happened was my co-worker did a
global find and replace with dreamweaver but that's all and I can't
personally see anything wrong with the above though I could be looking too
hard.
  


Should there be a comma between 'photo' and 'MATCH(word, def) etc'?

As in:
$query2 = SELECT word,def,photo, MATCH(word,def) AGAINST 
('$txtsearchword' IN BOOLEAN MODE) AS m FROM dictionary WHERE 
MATCH(word,def) AGAINST ('$txtsearchword' IN BOOLEAN MODE) LIMIT 
$offset, $item_perpage;



Much warmth,

planetthoughtful
---
Lost in thought
http://www.planetthoughtful.org

Urban legends, superstitions, ghost
stories and folklore
http://www.ulblog.org

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] FOUND THE PROBLEM WITH THE BAD CODE

2006-02-25 Thread Chris Payne
Hi there everyone,
 
thanks to everyone for the help with the bad MySQL query.  it turns out
there was some bad JAVASCRIPT at the top and the search itself was fine, I
tested it on my dev machine and just realized I have an older version of
MySQL on here than on the server and the server was FINE DOH so I took out
the bad javascript and all is fine but now I have to upgrade my MySQL as
didn't realize it was from 2002 !!!
 
thanks again.
 
Chris