473,322 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

can php mysql work in Windows but not Solaris?

can mysql work in Windows but not Solaris?
Is there any reason you can see why the fulltext php/mysql code below
works OK on my win2k php4.3.6. mysql 4.1.3 pc but does *not* work when
put on a Solaris Server with php5 mysql 4.1.6 ?

That is what happens...I'm suspicious of the accent characters in the
code but I am not sure if there's any truth to my suspicion and how I'd
even test or fix it(?) Here's the snip I think causes the problem:
....
else {
if ( $Type_Submit == 'radio_and') {
$radio_keyword = preg_replace('/\s+|^/', ' +', $keyword);
}
elseif ( $Type_Submit == 'radio_phrase'){
$radio_keyword = '"'.$keyword.'"';
}
$query =
"SELECT page.* FROM `page` LEFT JOIN `keywords` USING
(`page_id`) WHERE MATCH (`keywords`.`keyword_txt`)
AGAINST ('$radio_keyword' IN BOOLEAN MODE)
UNION
SELECT page.* FROM `page` WHERE MATCH (`title`, `descrip`)
AGAINST ('$radio_keyword' IN BOOLEAN MODE)
UNION
SELECT page.* FROM `page` LEFT JOIN `url_Pages` USING (`page_id`)
WHERE MATCH (`url_Pages`.`page_url`)
AGAINST ('$radio_keyword' IN BOOLEAN MODE)";
$result = mysql_query($query);
}

--
Jul 17 '05 #1
4 1816
"Hal Halloway" <Ha******@nospam.net> wrote in message
news:jOmGd.570$Hg6.260@trnddc09...
can mysql work in Windows but not Solaris?
Is there any reason you can see why the fulltext php/mysql code below
works OK on my win2k php4.3.6. mysql 4.1.3 pc but does *not* work when
put on a Solaris Server with php5 mysql 4.1.6 ?

That is what happens...I'm suspicious of the accent characters in the
code but I am not sure if there's any truth to my suspicion and how I'd
even test or fix it(?)
By writing your code in a manner that detects errors and deals with them
accordingly

-snip- $result = mysql_query($query);
}

$result = mysql_query($query , $conn);
if(! $result || mysql_error($conn))
{
echo "Unable to process query [$query] : " . mysql_error($conn);
}
Jul 17 '05 #2

Hal Halloway wrote:
can mysql work in Windows but not Solaris?
Is there any reason you can see why the fulltext php/mysql code below
works OK on my win2k php4.3.6. mysql 4.1.3 pc but does *not* work when put on a Solaris Server with php5 mysql 4.1.6 ?

That is what happens...I'm suspicious of the accent characters in the
code but I am not sure if there's any truth to my suspicion and how I'd even test or fix it(?) Here's the snip I think causes the problem:


You posted the same query on www.tek-tips.com ...

Here's my suggestions I posted there...

Where are your variables being set? If they are coming from a form or
the URL they this could be a problem with register_globals being set to
"on" on the Windows 2K pc and being set set to "off" on the Solaris
server.

If your variables are coming from a POSTED form use the superglobal
$_POST to retrieve the values. For instance assuming that your variable
$radio_keyword comes from a form, use $_POST['radio_keyword'] to get
the value. The same holds true if the variable comes from the URL,
except you would use the superglobal $_GET.

See http://www.php.net/ and read up on variable from outside of PHP.
Ken

Jul 17 '05 #3
Hal Halloway wrote:
can mysql work in Windows but not Solaris?
Is there any reason you can see why the fulltext php/mysql code below
works OK on my win2k php4.3.6. mysql 4.1.3 pc but does *not* work when
put on a Solaris Server with php5 mysql 4.1.6 ?

That is what happens...I'm suspicious of the accent characters in the
code but I am not sure if there's any truth to my suspicion and how I'd
even test or fix it(?) Here's the snip I think causes the problem:
...
else {
if ( $Type_Submit == 'radio_and') {
$radio_keyword = preg_replace('/\s+|^/', ' +', $keyword);
}
elseif ( $Type_Submit == 'radio_phrase'){
$radio_keyword = '"'.$keyword.'"';
}
$query =
"SELECT page.* FROM `page` LEFT JOIN `keywords` USING
(`page_id`) WHERE MATCH (`keywords`.`keyword_txt`)
AGAINST ('$radio_keyword' IN BOOLEAN MODE)
UNION
SELECT page.* FROM `page` WHERE MATCH (`title`, `descrip`)
AGAINST ('$radio_keyword' IN BOOLEAN MODE)
UNION
SELECT page.* FROM `page` LEFT JOIN `url_Pages` USING (`page_id`)
WHERE MATCH (`url_Pages`.`page_url`)
AGAINST ('$radio_keyword' IN BOOLEAN MODE)";
$result = mysql_query($query);
}


In addition to the things already recommended, while in the development
stage, I like to use a flag to optionally print out my queries to see
what they look like.

$debug = true;
..
..
if ($debug)
{
print "<pre>$query</re>";
}
$result = mysql_query($query);

One thing I noticed is you are wrapping the $keyword in double quotes
when you put it into $radio_keyword, then you wrap that in single quotes
when you build $query. So the SQL looks like

AGAINST ('"my_keyword"' IN BOOLEAN MODE)

I'm not sure how MySQL handles this. I.e., are the inner double quotes
part of the keyword. Why this would differ on different paltforms is
beyond me.

NM

--
convert uppercase WORDS to single keystrokes to reply
Jul 17 '05 #4


Thanks for the posts. I use all the advice.
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: pancho | last post by:
Greetings, I need help configuring/building PHP3 with MySQL as a DSO on a Solaris 8 box - this module is needed to host some existing sites I will be migrating Note. I built PHP4 from source and...
1
by: Yong Wang | last post by:
Hi, All: We have a network management system written in C++, MysQL, and Hp SNMP. It works in Solaris command line. When I wrote a similar python codes which call compiled C++ and mysql codes in...
0
by: Lenz Grimmer | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, MySQL 4.0.14, a new version of the popular Open Source/Free Software Database, has been released. It is now available in source and binary...
0
by: renniw one | last post by:
Hi, I have been trying to compile mysql on a solaris 8 machine. However, I am getting internal compiler errors. What compiler and version did anyone use to successfully compile mysql on a solaris...
0
by: rkusenet | last post by:
We are using a really old version of Solaris 2.6. Mysql.com site does not seem to have mysql binaries for this version of Solaris. The earliest version they have is for Solaris 8, which I believe...
1
by: Elliott B. | last post by:
We have been asigned a project required by our parent company to have our sales people fill out a form before billing any order to our customers. Our main system runs a Progress db, that's where...
1
by: shan_rish | last post by:
Hi Group, I am new to MySql. I installed Solaris 10 on a Pentium machine. Then i came to know that MySql comes bundled with Solaris 10. So i installed MySql which came with the Solaris 10. Then i...
0
by: Comcast | last post by:
I'm trying to do an install of mysql on a Sun Ultra 10 machine running Solaris 10 (1/06) which is a completely clean, fresh install. I can get the packaged (with Solaris 10) version of mysql...
110
by: alf | last post by:
Hi, is it possible that due to OS crash or mysql itself crash or some e.g. SCSI failure to lose all the data stored in the table (let's say million of 1KB rows). In other words what is the worst...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.