f



"Select" & "Order By" OK- ''WHERE'' Does'nt Work !

Before i post actual code, as i need a speedyish reply.
Can i first ask if anyone knows off the top of their head, if there is
a likely obvious cause to the following problem.
For the moment i've reduced my form request to a simple text string
entry, instead of my desired optional parameters. As i have been stuck
with a single unfathomable glitch for over a year.
Basically, if i enter queries such as ;
"select * from table" "select * from table order by artist",
it works perfectly. However if i introduce the 'where' option, as in
"select * from table where artist like whatever". It comes back with
"could not execute query". This happens even if i append "order by" to
it.
I'll post all the various codes if anyone can please help.
0
i.justice (13)
10/31/2003 8:21:07 PM
comp.lang.php 32646 articles. 0 followers. Post Follow

22 Replies
1226 Views

Similar Articles

[PageSpeed] 25

On 31-Oct-2003, i.justice@onmail.co.uk (ian justice) wrote:

> Before i post actual code, as i need a speedyish reply.
> Can i first ask if anyone knows off the top of their head, if there is
> a likely obvious cause to the following problem.
> For the moment i've reduced my form request to a simple text string
> entry, instead of my desired optional parameters. As i have been stuck
> with a single unfathomable glitch for over a year.
> Basically, if i enter queries such as ;
> "select * from table" "select * from table order by artist",
> it works perfectly. However if i introduce the 'where' option, as in
> "select * from table where artist like whatever". It comes back with
> "could not execute query". This happens even if i append "order by" to
> it.
> I'll post all the various codes if anyone can please help.

I teach students how to program. Almost every student is convinced, at one
time or another, that they have found a bug in the compiler, operating
system or hardware. In every case it's a problem with the student's code.

You are suggesting that somehow the SQL select where order by is broken for
some unspecified database system. The odds are about the same as my winning
the lottery without buying a ticket.

assuming the table and columns are correctly defined and the connection is
open and the database is selected and I haven't made a typo, the following
will work
"select * from sometable where somecolumn like 'somevalue%' order by
somecolumn"

If you want to help yourself
1) echo the actual SQL statement
2) add error capture code (e.g. 'or die(mysql_error())') to your connect,
dbselect and query calls

If you want more help here
1) show us the actual code including the echoed sql statement and error
message if any
2) show us the table definition
3) tell us which database you are using and what version
4) tell us the version of PHP and if it's in safe mode


-- 
Tom Thackrey
www.creative-light.com
tom (at) creative (dash) light (dot) com
do NOT send email to jamesbutler@willglen.net (it's reserved for spammers)
0
10/31/2003 10:17:59 PM
i.justice@onmail.co.uk (ian justice) schrieb:

> Before i post actual code, as i need a speedyish reply.
> Can i first ask if anyone knows off the top of their head, if there is
> a likely obvious cause to the following problem.
> For the moment i've reduced my form request to a simple text string
> entry, instead of my desired optional parameters. As i have been stuck
> with a single unfathomable glitch for over a year.
> Basically, if i enter queries such as ;
> "select * from table" "select * from table order by artist",
> it works perfectly. However if i introduce the 'where' option, as in
> "select * from table where artist like whatever". It comes back with
> "could not execute query". This happens even if i append "order by" to
> it.

Are you sure that youre query string looks like 
  select id from table order by id
and not like
  select id from tableorder by id
?

Please give us the version of PHP, the name of the DBMS that you're
using and some small example code.

Regards,
    Matthias
0
10/31/2003 10:25:46 PM
That was beautiful sir.
0
sh0t (1)
11/1/2003 2:39:46 AM
Matthias Esken <muelleimer2003nospam@usenetverwaltung.org> wrote in message news:<bnur1r.11s.1@usenet.esken.de>...
> 
> Are you sure that youre query string looks like 
>   select id from table order by id
> and not like
>   select id from tableorder by id
> ?
Yes
I'm writing this via web tv, however come Sunday i should be able to access a PC
and i'll post all the scripts.
 
> Please give us the version of PHP, the name of the DBMS that you're
> using and some small example code.
> 
> Regards,
>     Matthias
I'm using;
PHP4u Version 3.0 Based on PHP-4.3.2
MySQL 3.23.52
Thanks for your time so far.
0
i.justice (13)
11/1/2003 2:56:04 AM
>
>I'm using;
>PHP4u Version 3.0 Based on PHP-4.3.2
>MySQL 3.23.52
>Thanks for your time so far.
Correction MySQL 3.23.56
0
i.justice (13)
11/1/2003 3:03:42 AM
"Tom Thackrey" <use.signature@nospam.com> wrote in message news:<rcBob.8442$e73.8118@newssvr14.news.prodigy.com>...
> 
> I teach students how to program. Almost every student is convinced, at one
> time or another, that they have found a bug in the compiler, operating
> system or hardware. In every case it's a problem with the student's code.

I'm presuming it is my fault 

> You are suggesting that somehow the SQL select where order by is broken for
> some unspecified database system. The odds are about the same as my winning
> the lottery without buying a ticket.

Honestly not remotely suggesting such a thing :)

I'm replying to this via webtv, so unfortunately the rest of your
message can't be quoted as it doesn't show up on the reply form.
However, hopefully on Sunday i will be able to access a PC again. I
will then post the scripts.

I had already tried the syntax you suggested without success. The
database and MySQL connection are fine, as they select, sort and
display the results of a query such as "select * from table order by
column".

The versions i am using are as follows;
PHP4u Version 3.0 Based on 4.3.2
MySQL 3.23.56
Many thanks for your time and help so far, it's very much appreciated.
0
i.justice (13)
11/1/2003 3:15:42 AM
On 31-Oct-2003, i.justice@onmail.co.uk (ian justice) wrote:

> I had already tried the syntax you suggested without success. The
> database and MySQL connection are fine, as they select, sort and
> display the results of a query such as "select * from table order by
> column".
>
> The versions i am using are as follows;
> PHP4u Version 3.0 Based on 4.3.2
> MySQL 3.23.56
> Many thanks for your time and help so far, it's very much appreciated.

What error message did you get when you executed the query?
Are you sure there are records in the table that match your pattern?
If the syntax is correct, then the problem is probably with the table or
column names.  Are you using reserved words for either of these? Do they
exist?



-- 
Tom Thackrey
www.creative-light.com
tom (at) creative (dash) light (dot) com
do NOT send email to jamesbutler@willglen.net (it's reserved for spammers)
0
11/1/2003 5:56:53 AM
"Tom Thackrey" <use.signature@nospam.com> wrote in message news:<FWHob.11451$OS5.8313@newssvr14.news.prodigy.com>...
 
> What error message did you get when you executed the query?
> Are you sure there are records in the table that match your pattern?
> If the syntax is correct, then the problem is probably with the table or
> column names.  Are you using reserved words for either of these? Do they
> exist?

The error message was  "could not execute query". This is my own error
message as in
$rs=mysql_query($sql, $conn) or die ("could not execute query");

The records do exist i deliberately used simple one-word requests as
well. I also
checked i got the same error message by typing in a load of random
letters in the
text field.
The table is called 'music' and the columns are headed 'song' 'folder'
format' 'artist'.

Whether it's relevant to solving the puzzle, i don't know. But, i
stress again that i am
successfully connected to mysql and the database. As, it does
correctly sort and display
the result by the chosen 'order by' command, be it song, folder,
format or artist.
0
i.justice (13)
11/1/2003 9:56:12 PM
On  1-Nov-2003, i.justice@onmail.co.uk (ian justice) wrote:

> "Tom Thackrey" <use.signature@nospam.com> wrote in message
> news:<FWHob.11451$OS5.8313@newssvr14.news.prodigy.com>...
>
> > What error message did you get when you executed the query?
> > Are you sure there are records in the table that match your pattern?
> > If the syntax is correct, then the problem is probably with the table or
> > column names.  Are you using reserved words for either of these? Do they
> > exist?
>
> The error message was  "could not execute query". This is my own error
> message as in
> $rs=mysql_query($sql, $conn) or die ("could not execute query");

change it to
 $rs=mysql_query($sql, $conn) or die ("could not execute query because
 ".mysql_error());

>
> The records do exist i deliberately used simple one-word requests as
> well. I also
> checked i got the same error message by typing in a load of random
> letters in the
> text field.
> The table is called 'music' and the columns are headed 'song' 'folder'
> format' 'artist'.
>
> Whether it's relevant to solving the puzzle, i don't know. But, i
> stress again that i am
> successfully connected to mysql and the database. As, it does
> correctly sort and display
> the result by the chosen 'order by' command, be it song, folder,
> format or artist.

You'd save us all a lot of time if you'd just post the sql statement that's
failing along with the mysql error message.



-- 
Tom Thackrey
www.creative-light.com
tom (at) creative (dash) light (dot) com
do NOT send email to jamesbutler@willglen.net (it's reserved for spammers)
0
11/1/2003 11:06:05 PM
"Tom Thackrey" <use.signature@nospam.com> wrote in message news:<FWHob.11451$OS5.8313@newssvr14.news.prodigy.com>...
> On 31-Oct-2003, i.justice@onmail.co.uk (ian justice) wrote:
> 
> > The versions i am using are as follows;
> > PHP4u Version 3.0 Based on 4.3.2
> > MySQL 3.23.56

> If the syntax is correct

I'm relatively new to computers, so this may be a ludricous
suggestion. As in it would
leave my Database open to malicious destruction. However, if it
would'nt, ( i simply do
not know ). I could give you the URL of a copy of the Form that i'm
using and the PHP
script URL. Although presumably, that i not necessary as the Form has
that as the 'action'
and you can't view the PHP code.
I will still post the PHP code tomorrow.
0
i.justice (13)
11/2/2003 12:26:39 AM
"Tom Thackrey" <use.signature@nospam.com> wrote in message news:<x%Wob.939$vn3.605@newssvr29.news.prodigy.com>...
> On  1-Nov-2003, i.justice@onmail.co.uk (ian justice) wrote:
> 
> > "Tom Thackrey" <use.signature@nospam.com> wrote in message
> > news:<FWHob.11451$OS5.8313@newssvr14.news.prodigy.com>...
>> You'd save us all a lot of time if you'd just post the sql message
that's failling
>>along with the error message.

Sorry, i will paste the whole script on Tuesday at the latest. I'll
keep quiet
until then. Although i do know i kept it as basic as could be.
For instance the working parts of the HTML Form were,
<form action="page_name.php" method="POST"> I also tried "GET" with
exactly the same outcome.
<input type="text" name="write">
The 'crucial' ? part of the PHP Script was simply 
"$sql=$write". Which works fine without the where option.
0
i.justice (13)
11/2/2003 4:12:13 AM
On  1-Nov-2003, i.justice@onmail.co.uk (ian justice) wrote:

> "Tom Thackrey" <use.signature@nospam.com> wrote in message
> news:<x%Wob.939$vn3.605@newssvr29.news.prodigy.com>...
> > On  1-Nov-2003, i.justice@onmail.co.uk (ian justice) wrote:
> >
> > > "Tom Thackrey" <use.signature@nospam.com> wrote in message
> > > news:<FWHob.11451$OS5.8313@newssvr14.news.prodigy.com>...
> >> You'd save us all a lot of time if you'd just post the sql message
> that's failling
> >>along with the error message.
>
> Sorry, i will paste the whole script on Tuesday at the latest. I'll
> keep quiet
> until then. Although i do know i kept it as basic as could be.
> For instance the working parts of the HTML Form were,
> <form action="page_name.php" method="POST"> I also tried "GET" with
> exactly the same outcome.
> <input type="text" name="write">
> The 'crucial' ? part of the PHP Script was simply
> "$sql=$write". Which works fine without the where option.

I gather you are entering the sql in an <input field. You do know that if
you have magic quotes on your input will be escaped with back slashes
automatically which would transform "select * from table where col like
'something'" to "select * from table where col like \'something\'" causing a
mysql syntax error.

I suggest that you code in such a way that these type of errors become
obvious, for example:

$result = mysql_query($sql) or die("Error: $sql failed because
".mysql_error());





-- 
Tom Thackrey
www.creative-light.com
tom (at) creative (dash) light (dot) com
do NOT send email to jamesbutler@willglen.net (it's reserved for spammers)
0
11/2/2003 5:16:31 AM
I noticed that Message-ID:
<Pq0pb.980$Kn5.626@newssvr29.news.prodigy.com> from Tom Thackrey
contained the following:

>I gather you are entering the sql in an <input field. You do know that if
>you have magic quotes on your input will be escaped with back slashes
>automatically which would transform "select * from table where col like
>'something'" to "select * from table where col like \'something\'" causing a
>mysql syntax error.

And use 
$sql =stripslashes($write);

-- 
Geoff Berrow
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
0
blthecat (1680)
11/2/2003 7:47:06 AM
"Tom Thackrey" <use.signature@nospam.com> wrote in message news:<x%Wob.939$vn3.605@newssvr29.news.prodigy.com>...
> On  1-Nov-2003, i.justice@onmail.co.uk (ian justice) wrote:
> 
> > "Tom Thackrey" <use.signature@nospam.com> wrote in message
> > news:<FWHob.11451$OS5.8313@newssvr14.news.prodigy.com>...
>> You'd save us all a lot of time if you'd just post the sql
statement that's
>> failing along with the mysql error message.
>
The basic and simple form and scripts are given below.
					#######SHORT FORM########
<form method="get" action="file_name.php">
Write In Here <input type="textarea"  name="write" rows="1"
cols="400"><br><br>
<input type="submit" value="SEARCH">
<input type="reset" value="RESET">

					######SHORT SCRIPT########
<?php
$conn=@mysql_connect("localhost", "user_name", "password") or
die("could not connect");
$rs=@mysql_select_db("database_name", $conn) or die("could not connect
to database");
$sql="$write";
$rs=mysql_query($sql, $conn) or die("could not execute query");
$list="<table border=\"1\" cellpadding=\"2\">";
$list.="<tr><th>SONG</th>";
$list.="<th>FOLDER</th>";
$list.="<th>FORMAT</th>";
$list.="<th>ARTIST</th></tr>";
while($row=mysql_fetch_array($rs))
{
$list.="<tr>";
$list.="<td>".$row["SONG"]."</td>";
$list.="<td>".$row["FOLDER"]."</td>";
$list.="<td>".$row["FORMAT"]."</td>";
$list.="<td>".$row["ARTIST"]."</td>";
$list.="</tr>";
}
$list.="</table>";
echo($list);
?>

###############################################################################
			BE A GOD----SEND ME TO HEAVEN
If you want to have a great time and loads of fun. Please feel free to
tackle the problem with my 'Utopian script', which would send me
soaring to Heaven, emotionally, that is.
It produces the following parse error  "Parse error: parse error in
/data/members/paid/x/x/user_name/htdocs/directory_name/file_name.php
on line 9"



					###LONG SCRIPT#######

<?php
$conn=@mysql_connect("localhost", "user_name", "password") or
die("could not connect");
$rs=@mysql_select_db("database_name", $conn) or die("could not connect
to database");
$sql="select * from table_name where";
if(isset($song)){
$sql.="song="$song" and"
}
if(isset($folder)){
$sql.="folder="$folder" and"
}
if(isset($format)){
$sql.="format="$format" and"
}
if(isset($artist)){
$sql.="artist="$artist" and"
}
$sql=ereg_replace("and", "", "$sql");
if(isset($order)){
$sql.="order="$order"
}
$rs=mysql_query($sql, $conn) or die("could not execute query");
$list="<table border=\"1\" cellpadding=\"2\">";
$list.="<tr><th>SONG</th>";
$list.="<th>FOLDER</th>";
$list.="<th>FORMAT</th>";
$list.="<th>ARTIST</th></tr>";
while($row=mysql_fetch_array($rs))
{
$list.="<tr>";
$list.="<td>".$row["song"]."</td>";
$list.="<td>".$row["folder"]."</td>";
$list.="<td>".$row["format"]."</td>";
$list.="<td>".$row["artist"]."</td>";
$list.="</tr>";
}
$list.="</table>";
echo($list);
?>



					######LONG FORM#######

<form action="form_name.php" method="GET">

<b>SONG</b><br>
<input type="text" name="song" size="50"><br>
<b>FOLDER</b><br>
<input type="text" name="folder" size="2"><br>
<b>FORMAT</b><br>
<input type="text" name="format" size="20"><br>
<b>ARTIST</b><br>
<input type="text" name="artist" size="40"><br>

The percent sign can be used as a wildcard. You can place it at the
start, end or both ends with appropiate results.<br>

<b>ORDER RESULTS BY;</b><br>
<input type="radio" name="order" value="order by song"
checked><b>SONG</b><br>
<input type="radio" name="order" value="order by
folder"><b>FOLDER</b><br>
<input type="radio" name="order" value="order by
artist"><b>ARTIST</b>&nbsp

<input type="submit" value="SEARCH"><input type="reset"
value="RESET"><br><br>
</form>
0
i.justice (13)
11/4/2003 5:06:20 PM
On  4-Nov-2003, i.justice@onmail.co.uk (ian justice) wrote:

> The basic and simple form and scripts are given below.
>                     #######SHORT FORM########
> <form method="get" action="file_name.php">
> Write In Here <input type="textarea"  name="write" rows="1"
> cols="400"><br><br>
> <input type="submit" value="SEARCH">
> <input type="reset" value="RESET">
>
>                     ######SHORT SCRIPT########
> <?php
> $conn=@mysql_connect("localhost", "user_name", "password") or
> die("could not connect");
> $rs=@mysql_select_db("database_name", $conn) or die("could not connect
> to database");
> $sql="$write";

Unless you have register globals on you need to code the above as
$sql = $_POST['write'];

> $rs=mysql_query($sql, $conn) or die("could not execute query");

This would be more useful as
$rs=mysql_query($sql, $conn) or die("could not execute query [$sql] because
".mysql_error());


> $list="<table border=\"1\" cellpadding=\"2\">";
> $list.="<tr><th>SONG</th>";
> $list.="<th>FOLDER</th>";
> $list.="<th>FORMAT</th>";
> $list.="<th>ARTIST</th></tr>";
> while($row=mysql_fetch_array($rs))
> {
> $list.="<tr>";
> $list.="<td>".$row["SONG"]."</td>";
> $list.="<td>".$row["FOLDER"]."</td>";
> $list.="<td>".$row["FORMAT"]."</td>";
> $list.="<td>".$row["ARTIST"]."</td>";
> $list.="</tr>";
> }
> $list.="</table>";
> echo($list);
> ?>
>
> ###############################################################################
>             BE A GOD----SEND ME TO HEAVEN
> If you want to have a great time and loads of fun. Please feel free to
> tackle the problem with my 'Utopian script', which would send me
> soaring to Heaven, emotionally, that is.
> It produces the following parse error  "Parse error: parse error in
> /data/members/paid/x/x/user_name/htdocs/directory_name/file_name.php
> on line 9"
>
>
>
>                     ###LONG SCRIPT#######
>
> <?php
> $conn=@mysql_connect("localhost", "user_name", "password") or
> die("could not connect");
> $rs=@mysql_select_db("database_name", $conn) or die("could not connect
> to database");
> $sql="select * from table_name where";
> if(isset($song)){
> $sql.="song="$song" and"

The above has unescaped quotes and no ;, it also needs a space after the
'and' or you will end up with '... andfolder=...'
it should be
$sql.="song=\"$song\" and ";
the rest of these have the same problem

> }
> if(isset($folder)){
> $sql.="folder="$folder" and"
> }
> if(isset($format)){
> $sql.="format="$format" and"
> }
> if(isset($artist)){
> $sql.="artist="$artist" and"
> }
> $sql=ereg_replace("and", "", "$sql");

Huh? take the above out and replace it with

$sql .= ' 1 ';

> if(isset($order)){
> $sql.="order="$order"

should be
$sql .= "order=\"$order\"";


> }
> $rs=mysql_query($sql, $conn) or die("could not execute query");

see earlier comment about mysql_error()

> $list="<table border=\"1\" cellpadding=\"2\">";
> $list.="<tr><th>SONG</th>";
> $list.="<th>FOLDER</th>";
> $list.="<th>FORMAT</th>";
> $list.="<th>ARTIST</th></tr>";
> while($row=mysql_fetch_array($rs))
> {
> $list.="<tr>";
> $list.="<td>".$row["song"]."</td>";
> $list.="<td>".$row["folder"]."</td>";
> $list.="<td>".$row["format"]."</td>";
> $list.="<td>".$row["artist"]."</td>";
> $list.="</tr>";
> }
> $list.="</table>";
> echo($list);
> ?>
>
>
>
>                     ######LONG FORM#######
>
> <form action="form_name.php" method="GET">
>
> <b>SONG</b><br>
> <input type="text" name="song" size="50"><br>
> <b>FOLDER</b><br>
> <input type="text" name="folder" size="2"><br>
> <b>FORMAT</b><br>
> <input type="text" name="format" size="20"><br>
> <b>ARTIST</b><br>
> <input type="text" name="artist" size="40"><br>
>
> The percent sign can be used as a wildcard. You can place it at the
> start, end or both ends with appropiate results.<br>
>
> <b>ORDER RESULTS BY;</b><br>
> <input type="radio" name="order" value="order by song"
> checked><b>SONG</b><br>
> <input type="radio" name="order" value="order by
> folder"><b>FOLDER</b><br>
> <input type="radio" name="order" value="order by
> artist"><b>ARTIST</b>&nbsp
>
> <input type="submit" value="SEARCH"><input type="reset"
> value="RESET"><br><br>
> </form>

It's always useful to display your sql statements especially when you build
them in parts. That's why using the or die() to display the sql and the
error message is way more helpful than just displaying "i have an error,
guess what it is"

-- 
Tom Thackrey
www.creative-light.com
tom (at) creative (dash) light (dot) com
do NOT send email to jamesbutler@willglen.net (it's reserved for spammers)
0
11/4/2003 6:12:35 PM
"Tom Thackrey" <use.signature@nospam.com> wrote in message news:<n_Rpb.492$GH.50501888@newssvr21.news.prodigy.com>...
> 
> Unless you have register globals on you need to code the above as
> $sql = $_POST['write'];
>
They are turned on as far as i know. If it's of any help or
assistance, all the specifications are contained in this link
"http://www.php4u.info/phpinfo.php"
> > $rs=mysql_query($sql, $conn) or die("could not execute query");
> 
> This would be more useful as
> $rs=mysql_query($sql, $conn) or die("could not execute query [$sql] because
> ".mysql_error());
I had since added that extension, with very interesting results. There
is a possibility, that 'stripslashes' are involved. I'll have to go
and learn what they are first. I am very new to computers, never ever
haven even touched one until about eighteen months ago.
> > <?php
> > $conn=@mysql_connect("localhost", "user_name", "password") or
> > die("could not connect");
> > $rs=@mysql_select_db("database_name", $conn) or die("could not connect
> > to database");
> > $sql="select * from table_name where";
> > if(isset($song)){
> > $sql.="song="$song" and"
> 
> The above has unescaped quotes and no ;, it also needs a space after the
> 'and' or you will end up with '... andfolder=...'
> it should be
> $sql.="song=\"$song\" and ";
> the rest of these have the same problem

The 'and' mention looks to be a spectaculary thick oversight on my
part.
I'll have to look into this in detail. So much of the problems could
be that, ( i'm not removing blame from my scripting ), server specific
syntax. For example in the vast amount of reading i've done on php (
yes, apparently fruitless ), i had never seen mention of where, as in
my simple html form. One can enter a query successfully without using
any quotes or capitals.
Incidentally, if it would be of any help, i could publish here the
URL'S of my forms on nmy website. As, i'm sure the error messages now
being detailed would mean far more to yourself than me. I obviously
don't wish to leave my database open to malicious attack. Bearing in
mind it's an open text field entry. Presumably some bright spark could
easily drop the whole thing ???.

> > $sql=ereg_replace("and", "", "$sql");
> 
> Huh? take the above out and replace it with
> 
> $sql .= ' 1 ';
>
This ereg_replace 'thing' was something i found recommended in a forum
once. :) sorry. I'm very interested in your quoting of the '1'. As in
my database interface from my website provider, that is sometimes in
their syntax. Incidentally, they show the syntax of a request upon
successful ( or otherwise ) completion. However, if i copy and paste
it into their text field and run it, it astoundingly always says
syntax error !!!. Again, allowing for me being uneducated in computer
matters, i wonder if this is a result of 'stripslashes' etc. ?.
> 
> It's always useful to display your sql statements especially when you build
> them in parts. That's why using the or die() to display the sql and the
> error message is way more helpful than just displaying "i have an error,
> guess what it is"
 Taken on board.
0
i.justice (13)
11/5/2003 2:18:45 PM
Geoff Berrow <blthecat@ckdog.co.uk> wrote in message news:<qhd9qv48i825i3hqsrtbouedhnndfi9oie@4ax.com>...
> I noticed that Message-ID:
> <Pq0pb.980$Kn5.626@newssvr29.news.prodigy.com> from Tom Thackrey
> contained the following:
> 
> >I gather you are entering the sql in an <input field. You do know that if
> >you have magic quotes on your input will be escaped with back slashes
> >automatically which would transform "select * from table where col like
> >'something'" to "select * from table where col like \'something\'" causing a
> >mysql syntax error.
> 
> And use 
> $sql =stripslashes($write);

APOLOGIES IF THIS IS NOT PROTOCOL. BUT, SOME THINGS IN LIFE HAVE TO BE
IN BIG BLOCK LETTERS. I HAVE JUST ADDED THE 'STRIPSLASHES' TO MY
SIMPLE TEST FORM. EVERYTHING WORKS. SO, IF ONLY I CAN WORK IT INTO MY
LONG VERSION. ALTHOUGH, I FEAR I HAVE MANY MORE MISTAKES LURKING
WITHIN THAT SCRIPT. HOWEVER, FOR NOW, MANY, MANY SINCERE THANKS. I'M
ABSOLUTELY STUNNED.
0
i.justice (13)
11/5/2003 2:30:24 PM
On  5-Nov-2003, i.justice@onmail.co.uk (ian justice) wrote:

> "Tom Thackrey" <use.signature@nospam.com> wrote in message
> news:<n_Rpb.492$GH.50501888@newssvr21.news.prodigy.com>...
> >
> > Unless you have register globals on you need to code the above as
> > $sql = $_POST['write'];
> >
> They are turned on as far as i know. If it's of any help or
> assistance, all the specifications are contained in this link
> "http://www.php4u.info/phpinfo.php"
> > > $rs=mysql_query($sql, $conn) or die("could not execute query");
> >
> > This would be more useful as
> > $rs=mysql_query($sql, $conn) or die("could not execute query [$sql]
> > because
> > ".mysql_error());
> I had since added that extension, with very interesting results. There
> is a possibility, that 'stripslashes' are involved. I'll have to go
> and learn what they are first. I am very new to computers, never ever
> haven even touched one until about eighteen months ago.
> > > <?php
> > > $conn=@mysql_connect("localhost", "user_name", "password") or
> > > die("could not connect");
> > > $rs=@mysql_select_db("database_name", $conn) or die("could not connect
> > > to database");
> > > $sql="select * from table_name where";
> > > if(isset($song)){
> > > $sql.="song="$song" and"
> >
> > The above has unescaped quotes and no ;, it also needs a space after the
> > 'and' or you will end up with '... andfolder=...'
> > it should be
> > $sql.="song=\"$song\" and ";
> > the rest of these have the same problem
>
> The 'and' mention looks to be a spectaculary thick oversight on my
> part.
> I'll have to look into this in detail. So much of the problems could
> be that, ( i'm not removing blame from my scripting ), server specific
> syntax. For example in the vast amount of reading i've done on php (
> yes, apparently fruitless ), i had never seen mention of where, as in
> my simple html form. One can enter a query successfully without using
> any quotes or capitals.
> Incidentally, if it would be of any help, i could publish here the
> URL'S of my forms on nmy website. As, i'm sure the error messages now
> being detailed would mean far more to yourself than me. I obviously
> don't wish to leave my database open to malicious attack. Bearing in
> mind it's an open text field entry. Presumably some bright spark could
> easily drop the whole thing ???.
>
> > > $sql=ereg_replace("and", "", "$sql");
> >
> > Huh? take the above out and replace it with
> >
> > $sql .= ' 1 ';
> >
> This ereg_replace 'thing' was something i found recommended in a forum
> once. :) sorry. I'm very interested in your quoting of the '1'. As in
> my database interface from my website provider, that is sometimes in
> their syntax. Incidentally, they show the syntax of a request upon
> successful ( or otherwise ) completion. However, if i copy and paste
> it into their text field and run it, it astoundingly always says
> syntax error !!!. Again, allowing for me being uneducated in computer
> matters, i wonder if this is a result of 'stripslashes' etc. ?.
> >
> > It's always useful to display your sql statements especially when you
> > build
> > them in parts. That's why using the or die() to display the sql and the
> > error message is way more helpful than just displaying "i have an error,
> > guess what it is"
>  Taken on board.

In looking at your phpinfo() I see that you have register_globals On,
safe_mode On, and magic_quotes On.

Register Globals On means that you do not have to use $_POST[] and $_GET[]
to retrieve values from the previous page. The values will be available
directly as global variables. (It's still a good idea to use $_POST etc.
it's safer and doesn't rely on register globals being On.)

Safe Mode On restricts the things you can do, like where you can create or
read files, etc.

Magic Quotes On causes any input from the user to be escaped with slashes.
If the user enters "Don't feed the bears.", the string will appear in your
PHP program as "Don\'t feed the bears." this is suitable for entering as
data in a database, but could cause problems if you are trying to pass whole
sql statements. Use stripslashes() to remove these escapes.

The $str .= ' 1 '; I suggested was to compensate for the ' and ' you put
after each argument. Doing it your way would result in something like

select * from table where song='cherish' and order by somename

adding the 1 makes it legal syntax

select * from table where song='cherish' and 1 order by somename

it also works when no field is specified

select * from table where 1 order by somename











-- 
Tom Thackrey
www.creative-light.com
tom (at) creative (dash) light (dot) com
do NOT send email to jamesbutler@willglen.net (it's reserved for spammers)
0
11/5/2003 5:33:39 PM
i.justice@onmail.co.uk (ian justice) wrote in message news:<f6c8e066.0311050630.29199968@posting.google.com>...

> 
> APOLOGIES IF THIS IS NOT PROTOCOL. BUT, SOME THINGS IN LIFE HAVE TO BE
> IN BIG BLOCK LETTERS. I HAVE JUST ADDED THE 'STRIPSLASHES' TO MY
> SIMPLE TEST FORM. EVERYTHING WORKS. SO, IF ONLY I CAN WORK IT INTO MY
> LONG VERSION. ALTHOUGH, I FEAR I HAVE MANY MORE MISTAKES LURKING
> WITHIN THAT SCRIPT. HOWEVER, FOR NOW, MANY, MANY SINCERE THANKS. I'M
> ABSOLUTELY STUNNED.

SORTED-
Finally, sorted everything out, especially the long script.
If anyone down the line comes across this posting and it helps them
out, please say so. I'm delighted to have solved the matter after a
horrifically long time.
The two major problems lay where i had realised they were likely to
be. That is, in the necessary use of the 'stripslashes' function.
Also, with just one exception, absolutely no punctuation should be
used in the sql query syntax. I had feared that server
specific/website provider nuances would play a part in the matter. The
only bit that needed it was the Wild-Card part using '%%'.
The form and scripts are detailed below.

######INPUT FORM######

<form method="POST" action="script_name.php">
<b>
<dl>
<dt><font color="#000099">SELECT ALL WHERE </font> <br>
<dd><input type="radio" name="a" value="song" checked><b>SONG</b><br>
<dd><input type="radio" name="a" value="folder"><b>FOLDER</b><br>
<dd><input type="radio" name="a" value="format"><b>FORMAT</b><br>
<dd><input type="radio" name="a" value="artist"><b>ARTIST</b><br><br>

<dt><font color="#000099">LIKE </font><br>
<dd><input type="textarea" name="b" rows="1" cols="50"> <font
color="#ff0000">If you don't know the exact wording, enter what you
know. As the Search employs an automatic Wild-Card
system.</font><br><br>

<dt><font color="#000099">ORDER BY</font> <br>
<dd><input type="radio" name="c" value="song" checked><b>SONG</b><br>
<dd><input type="radio" name="c" value="folder"><b>FOLDER</b><br>
<dd><input type="radio" name="c" value="artist"><b>ARTIST</b><br><br>

<input type="submit" value="SEARCH"><input type="reset" value="RESET">
</form>


######PHP SCRIPT######

<a href="form_name.php">Submit New Search</a>
<?php
$conn=@mysql_connect("localhost", "user", "password") or die("could
not connect");
$rs=@mysql_select_db("database_name", $conn) or die("could not connect
to database");
$sql=stripslashes ("select * from database_name where $a like '%$b%'
order by $c");

$rs=mysql_query($sql, $conn) or die("could not execute query because
".mysql_error());
$list="<table border=\"1\" cellpadding=\"2\">";
$list.="<tr><th>SONG</th>";
$list.="<th>FOLDER</th>";
$list.="<th>FORMAT</th>";
$list.="<th>ARTIST</th></tr>";
while($row=mysql_fetch_array($rs))
{
$list.="<tr>";
$list.="<td>".$row["SONG"]."</td>";
$list.="<td>".$row["FOLDER"]."</td>";
$list.="<td>".$row["FORMAT"]."</td>";
$list.="<td>".$row["ARTIST"]."</td>";
$list.="</tr>";
}
$list.="</table>";
echo($list);
?>
<a href="form_name.php">Submit New Search</a>

I'll be well chuffed if it helps someone else out in the future.
Thanks to all for helping me along.
0
i.justice (13)
11/12/2003 6:38:04 PM
i.justice@onmail.co.uk (ian justice) wrote in message news
> 
> APOLOGIES IF THIS IS NOT PROTOCOL. BUT, SOME THINGS IN LIFE HAVE TO BE
> IN BIG BLOCK LETTERS. I HAVE JUST ADDED THE 'STRIPSLASHES' TO MY
> SIMPLE TEST FORM. EVERYTHING WORKS. SO, IF ONLY I CAN WORK IT INTO MY
> LONG VERSION. ALTHOUGH, I FEAR I HAVE MANY MORE MISTAKES LURKING
> WITHIN THAT SCRIPT. HOWEVER, FOR NOW, MANY, MANY SINCERE THANKS. I'M
> ABSOLUTELY STUNNED.

Updated Form to include instant A-Z, with simple HTML and 3 copies of
the PHP script;
<form method="POST" action="artist_script.php">
<center>ARTIST A-Z</center>
<input type="radio" name="aaz" value="A">A
<input type="radio" name="aaz" value="B">B
<input type="radio" name="aaz" value="C">C
<input type="radio" name="aaz" value="D">D
<input type="radio" name="aaz" value="E">E
<input type="radio" name="aaz" value="F">F
<input type="radio" name="aaz" value="G">G
<input type="radio" name="aaz" value="H">H
<input type="radio" name="aaz" value="I">I
<input type="radio" name="aaz" value="J">J
<input type="radio" name="aaz" value="K">K
<input type="radio" name="aaz" value="L">L
<input type="radio" name="aaz" value="M">M
<input type="radio" name="aaz" value="N">N
<input type="radio" name="aaz" value="O">O
<input type="radio" name="aaz" value="P">P
<input type="radio" name="aaz" value="Q">Q
<input type="radio" name="aaz" value="R">R
<input type="radio" name="aaz" value="S">S
<input type="radio" name="aaz" value="T">T
<input type="radio" name="aaz" value="U">U
<input type="radio" name="aaz" value="V">V
<input type="radio" name="aaz" value="W">W
<input type="radio" name="aaz" value="X">X
<input type="radio" name="aaz" value="Y">Y
<input type="radio" name="aaz" value="Z">Z
<input type="radio" name="aaz" value="0-9">0-9<br><br>
<input type="submit" value="SEARCH"><input type="reset" value="RESET">
</form>


<form method="POST" action="folder_script.php">
<center>FOLDER A-Z</center>
<input type="radio" name="faz" value="A">A
<input type="radio" name="faz" value="B">B
<input type="radio" name="faz" value="C">C
<input type="radio" name="faz" value="D">D
<input type="radio" name="faz" value="E">E
<input type="radio" name="faz" value="F">F
<input type="radio" name="faz" value="G">G
<input type="radio" name="faz" value="H">H
<input type="radio" name="faz" value="I">I
<input type="radio" name="faz" value="J">J
<input type="radio" name="faz" value="K">K
<input type="radio" name="faz" value="L">L
<input type="radio" name="faz" value="M">M
<input type="radio" name="faz" value="N">N
<input type="radio" name="faz" value="O">O
<input type="radio" name="faz" value="P">P
<input type="radio" name="faz" value="Q">Q
<input type="radio" name="faz" value="R">R
<input type="radio" name="faz" value="S">S
<input type="radio" name="faz" value="T">T
<input type="radio" name="faz" value="U">U
<input type="radio" name="faz" value="V">V
<input type="radio" name="faz" value="W">W
<input type="radio" name="faz" value="X">X
<input type="radio" name="faz" value="Y">Y
<input type="radio" name="faz" value="Z">Z
<input type="radio" name="faz" value="0-9">0-9<br><br>
<input type="submit" value="SEARCH"><input type="reset" value="RESET">
</form>


<form method="POST" action="song_script.php">
<center>SONG A-Z</center>
<input type="radio" name="saz" value="A">A
<input type="radio" name="saz" value="B">B
<input type="radio" name="saz" value="C">C
<input type="radio" name="saz" value="D">D
<input type="radio" name="saz" value="E">E
<input type="radio" name="saz" value="F">F
<input type="radio" name="saz" value="G">G
<input type="radio" name="saz" value="H">H
<input type="radio" name="saz" value="I">I
<input type="radio" name="saz" value="J">J
<input type="radio" name="saz" value="K">K
<input type="radio" name="saz" value="L">L
<input type="radio" name="saz" value="M">M
<input type="radio" name="saz" value="N">N
<input type="radio" name="saz" value="O">O
<input type="radio" name="saz" value="P">P
<input type="radio" name="saz" value="Q">Q
<input type="radio" name="saz" value="R">R
<input type="radio" name="saz" value="S">S
<input type="radio" name="saz" value="T">T
<input type="radio" name="saz" value="U">U
<input type="radio" name="saz" value="V">V
<input type="radio" name="saz" value="W">W
<input type="radio" name="saz" value="X">X
<input type="radio" name="saz" value="Y">Y
<input type="radio" name="saz" value="Z">Z
<input type="radio" name="saz" value="0-9">0-9<br><br>
<input type="submit" value="SEARCH"><input type="reset" value="RESET">
</form>
0
i.justice (13)
11/12/2003 7:55:19 PM
After using the Database over a period of time. I came across
performance glitches. Not least, that i no longer had the ability to
put forward more complex queries involving several fields, than
provided for at present.
However, if anyone in the future comes across the same type of
problems. Just reply to this posting and i'll post the scripts
necessary.
Everything on the Database and interacting page is perfectly tailored
to my needs and working as desired.
When i get the time, i will post ALL the scripts and forms involved,
in a single post.
0
11/18/2003 6:05:50 PM
webmistress@manchesterpaul.net (Stupidgirl) wrote in message news:<30d56be7.0311181005.5b9b19f6@posting.google.com>...
> After using the Database over a period of time. I came across
> performance glitches. Not least, that i no longer had the ability to
> put forward more complex queries involving several fields, than
> provided for at present.
> However, if anyone in the future comes across the same type of
> problems. Just reply to this posting and i'll post the scripts
> necessary.
> Everything on the Database and interacting page is perfectly tailored
> to my needs and working as desired.
> When i get the time, i will post ALL the scripts and forms involved,
> in a single post.

CONFUSION CLARIFICATION 1:
The author of the above message was actually myself (i.Justice @ onmail.co.uk).
My girlfriend had been posting to Google Groups and i inadvertently used her Login.

CONFUSION CLARIFICATION 2.
Pretty bad wording by myself. To make it clear, with my updated script, i can now
successfully use complex queries.
0
i.justice (13)
11/20/2003 6:10:09 AM
Reply:

Similar Artilces:

'quote' to `quote'
Hi, what is the way to change 'shocking,' said Sally into `shocking', said Sally automatically as Tex read the author.txt file? Does this method also change "whatever happens," he said into ``whatever happens.'' he said. David R David R <angel_ov_north@tiscali.co.uk> wrote: > what is the way to change 'shocking,' said Sally > into `shocking', said Sally > automatically as Tex read the > author.txt file? It is possible (e.g. via an active '). But I suspect, this is a lot easier using a script language or similar. Also you should consider ['s] coming from genitive and other uses of the apostrophe. Yours sincerely Heiko <oberdiek@uni-freiburg.de> David R wrote: > what is the way to change 'shocking,' said Sally > into `shocking', said Sally > automatically as Tex read the > author.txt file? Tricky thing to do on the TeX level because you can't tell a quote from an apostrophe in a reliable and efficient way. This will probably require pre-processing of author.txt (it's no big deal with regular expressions). > Does this method also change "whatever happens," he said > into ``whatever happens.'' he said. Assuming you're using Latex: try the csquotes package. See \MakeOuterQuote{"} in the tutorial. -- Sender address blackholed; do not reply to From: address. You can still reach me by email at: plehman gmx net. On Wed, 10 Ja...

Re: Mandis Quotes (aka retiring """ and ''')
Russell Nelson wrote: > If you need to put a single quote in, then you put > an arbitrary string in-between the single quotes which does NOT > appear in the string. For example, "Bill's house" becomes > 'x'Bill's house'x'. So possible examples might be: 'xx'somebody's mother'xx' 'xy'somebody's father'xy' 'wink'somebody's uncle'wink' 'quote'somebody's body'quote' not terrible easy on the eyes, and why use the single quote at all? Why no= t use a similar pattern li...

expect script : "expect 'X', send 'Y'" until expect "Z".
Hi. I am having some difficulties with an expect script, and was hoping someone could help me out here. I am running a scripted telnet session to some 'black box' appliance, and would like to retrieve the output of a particular command. However, the output of the command is longer than a single screen full. Since it was designed for interactive use, you get the magic string "[=More (xx%)=]" after each screenfull of output, at which point the command expects you to hit the spacebar in order to get another screenfull of output. Of course, I could just "send <space>" a few times, but since I have no idea how long the output will be in advance, this does not appear to be such a good approach. It looks like I would have to do something were I keep sending a space as long as I keep getting/expecting the string "[=More (xx%)=]", and stop doing that after I have gotten/expected the prompt again. (which is "% "). Does anyone have any idea on how to do such a thing in expect ? Of course, other suggestions to tackle the same problem are welcome as well of course. Sincerely, John Smith. "J.Smith" <lbalbalba@hotmail.com> wrote in message news:737da4e2.0410200305.1f12696f@posting.google.com... > Hi. > > > I am having some difficulties with an expect script, and was hoping > someone could help me out here. > > > I am running a scripted telnet session to some 'black box' applianc...

Re: Mandis Quotes (aka retiring """ and ''') #2
Russell Nelson notes: > = > Choose poor examples, and then criticize them as poor choices? > = true enough, but the suggested scheme introduces another variable into the = language syntax; I might always make good choices <wink> on what delimiter = I choose, but I might also end up working on code written by someone else w= ho makes less good choices. Or vice versa. = > Exactly. It really would be better to have one(1) string literal > which can quote anything without reverting to backslashing. Why one? > Simpler parsing, simpler learning of the language, fewe...

Unable to identify an operator '*=' for types 'character varying[]' and '"unknown"'
Okay.I'm following the documentation that came with the PostgreSQL source code (located in /usr/doc/postgresql-7.3.4-2/html/arrays.hmtl in my cygwin root). I created have a table with a varchar array in it, kind of like the following: CREATE TABLE tbl_db_usuario_detalles (NOMBRE varchar(50), COD_USE varchar(6)[]); I've added a single record that has two values. It is imported from a tab-separated text file that has one line, like the following: Username {xxxxxx,yyyyyy} The import seems to work fine (if I put quotes around the string values in the array it fails). ...

method="POST" changes '.' to '_'
I am trying to use POST to transfer data to another page. When I do this, '.' characters get converted to"_". For example: #index.html: <form action="test.php" method="post"> <input type="submit" name="filename.txt"> </form> #test.php <html> <?php var_dump( $_POST ); ?> </html> This displays: array(1) { ["filename_txt"]=> string(12) "Submit Query" } ie 'filename.txt' is changed to 'filename_txt' How can I stop this behaviour? On 6 Jul 2006 15:07:59 -0700, "Robert S" <robert.spam.me.senseless@gmail.com> wrote: >I am trying to use POST to transfer data to another page. When I do >this, '.' characters get converted to"_". For example: > >#index.html: ><form action="test.php" method="post"> ><input type="submit" name="filename.txt"> ></form> > >#test.php ><html> ><?php >var_dump( $_POST ); >?> ></html> > >This displays: > >array(1) { ["filename_txt"]=> string(12) "Submit Query" } > >ie 'filename.txt' is changed to 'filename_txt' >How can I stop this behaviour? You'd have to patch PHP. See main/php_variables.c, php_register_variable_ex (line 92 in PHP 5.1.4): /* ensure that we don't have spaces or dots in the varia...

"cannot convert parameter from 'short **' to 'void **'"
int func(void**); { short* p = NULL; func(&p); //<<< here } Could somebody remind me why is this not allowed ? error message: "cannot convert parameter from 'short **' to 'void **'" Thanks, Igor On 2005-11-22, Igor Okulist <igor@remove_this_okulist.com> wrote: > int func(void**); > > { > short* p = NULL; > func(&p); //<<< here > } > > Could somebody remind me why is this not allowed ? error > message: "cannot convert parameter from 'short **' to 'void > **'" ...

Re: Unable to identify an operator '*=' for types 'character varying[]' and '"unknown"'
Okay...I answered my own question. I didn't understand from the directions that I had to compile and install the dll in contrib/array and run the array_iterator.sql. It works like a charm now. Mike -----Original Message----- From: Mike Leahy [mailto:mgleahy@fes.uwaterloo.ca] Sent: October 10, 2003 3:41 PM To: 'pgsql-general@postgresql.org' Subject: Unable to identify an operator '*=' for types 'character varying[]' and '"unknown"' Okay.I'm following the documentation that came with the PostgreSQL source code (located in /u...

"Method 'Controls' of ojbect 'CommandBarPopup' failed" ?
I get this error every so often. Some bogus error number (such as -2147467259), too. Google searches imply that it can be caused by manually adding/deleting menu items on the fly, but it happens to me when a modal form is active and a timer function fires. Some of the code it runs (not sure what exactly) breaks it. Part of the menus are then hosed (i.e., you click and it doesn't "drop down", even if there are items in there). The only "solution" I've found is to resort to a backup and re-code everything since that point. Can anyone help me find a better solution than this? It might help to see the relevant code. "Jon" <None@hotmail.com> wrote in message news:kbqnqv0d8g7spes9f839vb9nkb4ipf6jlh@4ax.com... > I get this error every so often. Some bogus error number (such as > -2147467259), too. > > Google searches imply that it can be caused by manually > adding/deleting menu items on the fly, but it happens to me when a > modal form is active and a timer function fires. Some of the code it > runs (not sure what exactly) breaks it. Part of the menus are then > hosed (i.e., you click and it doesn't "drop down", even if there are > items in there). > > The only "solution" I've found is to resort to a backup and re-code > everything since that point. > > Can anyone help me find a better solution than this? ...

ABF "error: expected identifier or '(' before '=' token"
When trying to compile an ABF application on a Red Hat Enterprise Linux Server release 5.4,Intel(R) Xeon(R) and II 9.1.2 (int.lnx/ 100)NPTL, I get the following errors : "Processing form 'ylxo60701p' . . . Forcing compilation to create object file. Compiling '218688.c' . . . 218688.c:1420: error: expected identifier or '(' before '=' token E_AB001E Compilation failed" I've found out that the form in question (218688.c) is missing the global FRAME identifier here : FRAME * = { &_form0 }; which should be replaced wi...

VB6 & Jet 4 & MDAC 2.7 RTM challenge
VB6 & Jet 4 & MDAC 2.7 RTM challenge - "Method '~' of object '~' failed" I've spent more than three full days trying to get a VB6 program to talk to my Access 2002 database, and gives error -2147024769 while refusing to connect to the local database. The program works on a development machine and used to also work on a WinXP clean install. However, now, it won't work no matter what I do even though the program is unchanged. In an attempt to solve this problem, I created versions using different MDACs using Microsoft's Visual Studio 6 deployment wizard without success. I also installed Jet 4 separately as well as MS Access 2002... all without any luck. What should my next step be to get this going??? It is so bizarre that this program worked before on a clean install and while nothing has changed, it now won't connect to the database anymore. Someone a few years ago in a newsgroup said "error message -2147024769 means "the specified procedure could not be found and that a function in a module is missing." Is this true? If it is, what does that mean for my problem solving? Thanks in advance. Brian ...

VB6 & Jet 4 & MDAC 2.7 RTM challenge
VB6 & Jet 4 & MDAC 2.7 RTM challenge - "Method '~' of object '~' failed" I've spent more than three full days trying to get a VB6 program to talk to my Access 2002 database, and gives error -2147024769 while refusing to connect to the local database. The program works on a development machine and used to also work on a WinXP clean install. However, now, it won't work no matter what I do even though the program is unchanged. In an attempt to solve this problem, I created versions using different MDACs using Microsoft's Visual Studio ...

Quotes from the 'tolerant', 'liberal', 'progressive' Left
"I hope his wife feeds him lots of eggs and butter and he dies early like many black men do, of heart disease. ... He is an absolutely reprehensible person." --USA Today Columnist Julianne Malveaux on Justice Clarence Thomas "If there is...justice, he'll get AIDS, or one of his grandchildren will get it." --National Public Radio's (NPR) Nina Totenberg on Sen. Jesse Helms "[I]t may take the destruction of Western Civilization to allow the rest of the world to really emerge as a free and brotherly society." --Newly elected president of that hot-bed of co...

Environ("username") / Dev Ashish's "fOSUserName" function return '#Name?' on some clients
I am trying to retrieve the user name (network login) of clients running a local Access DB. We use Access 2000 / 2003 and Windows XP SP 2. I have used 2 different ways to access this information from within Access: OPTION 1: Use Environ("username") OPTION 2: Use Dev Ashish's code (http://www.mvps.org/access/api/ api0008.htm) Both options seem to behave exactly the same for me. But this is my problem: On some clients I correctly retrieve the network login name and on some other clients I retrieve '#Name?'. On ALL clients though, if you you open command prompt and execute 'echo %username%' you get the correct answer - even on the clients that I get the '#Name?' answer. I suspect I have some missing reference somewhere in the clients that can't display the username correctly but I don't know how to go about it. Any assistance is appreciated. ...

'Here's the thing about Apple's "recent"�success.'
'It isn't recent. The only thing that has changed are some numbers. Some big numbers: largest company in the world, second most profitable company in the world, most profitable retail stores in the world, best-selling smart phone, second best-selling smart phone, best-selling tablet computer, etc. Other numbers have not changed: customer satisfaction, customer loyalty, consumer ratings, etc.' <http://granthuhn.wordpress.com/2011/09/23/heres-the-thing-about-apples-r ecent-success/> -- "The iPhone doesn't have a speaker phone" -- "I checked very carefully" -- "I checked Apple's web pages" -- Edwin on the iPhone "It is Mac OS X, not BSD.' -- 'From Mac OS to BSD Unix." -- "It's BSD Unix with Apple's APIs and GUI on top of it' -- 'nothing but BSD Unix' (Edwin on Mac OS X) '[The IBM PC] could boot multiple OS, such as DOS, C/PM, GEM, etc.' -- 'I claimed nothing about GEM other than it was available software for the IBM PC. (Edwin on GEM) 'Solaris is just a marketing rename of Sun OS.' -- 'Sun OS is not included on the timeline of Solaris because it's a different OS.' (Edwin on Sun) "Alan Baker" wrote in message news:alangbaker-70BC8E.10314523092011@news.shawcable.net... 'It isn't recent. The only thing that has changed are some numbers. Some big numbers: largest company in the wor...

FSF Says "No" to Mono and Microsoft 'Community' 'Promise'
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Microsoft's Empty Promise Last week, Microsoft extended the terms of their Community Promise to implementations of the ECMA 334 and 335 standards. You might think this means it's safe to write your software in C#. However, this promise is full of loopholes, and it's nowhere near enough to make C# safe. Why Worry About C#? Since we published Richard's article about Mono last week, some people have been asking us why we're expressing special concern about free software developers relying on C# and Mono, instead of other languages. Sun probably has patents that cover Java. Maybe IBM has patents that cover C compilers. "Shouldn't we discourage the use of these too?" they ask. It's true that all software patents are a threat to developers—but that doesn't mean that all software patents are equally threatening. Different companies might have patents that could be used to attack other languages, but if we worried about every patent that could be used against us, we wouldn't get anything done. Microsoft's patents are much more dangerous: it's the only major software company that has declared itself the enemy of GNU/Linux and stated its intention to attack our community with patents. If Microsoft designed a patent trap into C#, that is no more than what it said it would do. The company has been quite clear about its intentions since late 2006. At a user conference in November that ...

Why doesn't Python's "robotparser" like Wikipedia's "robots.txt" file?
For some reason, Python's parser for "robots.txt" files doesn't like Wikipedia's "robots.txt" file: >>> import robotparser >>> url = 'http://wikipedia.org/robots.txt' >>> chk = robotparser.RobotFileParser() >>> chk.set_url(url) >>> chk.read() >>> testurl = 'http://wikipedia.org' >>> chk.can_fetch('Mozilla', testurl) False >>> The Wikipedia robots.txt file passes robots.txt validation, and it doesn't disallow unknown browsers. But the Python pars...

Dev C++ Err "expected `]' before ';' token" / source "DWORD rtec_Stack[XYZ_SIZE] __attribute__((aligned(4)));"
In Dev C++, we tried to compile a application, but it will throw some peculiar error. please find it below "path/main.cpp expected `]' before ';' token" and the source code is "DWORD rtec_Stack[XYZ_SIZE] __attribute__((aligned(4)));" is this problem of envirnment or else? nagaraj wrote: > In Dev C++, we tried to compile a application, but it will throw some > peculiar error. please find it below > > "path/main.cpp expected `]' before ';' token" and the source code is > "DWORD rtec_Stack[XYZ_SIZE] __attribute__((align...

ERROR: "Method 'Connection' of object '_Current Project' failed."
I have created a front-end application and back-end database. Everytime that I opened the program in the past, it open just fine with no errors when linking to the back-end tables. lately, I get the following error message whenever I open my application: ERROR: "Method 'Connection' of object '_Current Project' failed. Check to see if you installed the tables used for storing data is in the default directory. -2147024769 After clicking, "OK", my application continues on to open anyway. I have checked the application to determine if the intended location for the link tables where in view and relinked them to be sure. Each of the forms continue to show data from the backend. But, I continue to get the above error message. Any clues? John ...

Compile time error: "error: 'write_n' is not a member of 'ACE'"
Hi All, ACE VERSION: 5.5.6 HOST MACHINE and OPERATING SYSTEM: LINUX, Kernel 2.6.19-1.2288.fc5, i686 I tried to compile the program given below, but was giving following compilation error: Please help me to compile this proram --------------------------------------- COMPILATION------------------------------------------ [root@paresh ACE_MSG_BLOCK]# g++ main.C -o main -lACE -IACE_ROOT main.C: In function 'int main(int, char**)': main.C:9: error: 'read_n' is not a member of 'ACE' main.C:20: error: 'write_n' is not a member of 'ACE' ----------------------------------END COMPILATION-------------------------------------------- ---------------------------------------------PROGRAM main.C--------------------------------------------- #include "ace/OS.h" #include "ace/Message_Block.h" int main(int argc, char* argv[]) { ACE_Message_Block *head = new ACE_Message_Block(BUFSIZ); ACE_Message_Block *mblk = head; for(;;) { ssize_t nbytes = ACE::read_n(ACE_STDIN, mblk- >wr_ptr(), mblk->size()); if(nbytes <= 0) break; mblk->wr_ptr(nbytes); mblk->cont(new ACE_Message_Block(BUFSIZ)); mblk = mblk->cont(); } for(mblk = head; mblk != 0/*NULL POINTER*/; mblk = mblk- >cont()) { ACE::write_n(ACE_STDOUT, mblk-&g...

How to solve "Tables or functions 'inserted' and 'inserted' have the same exposed names. "
Hi all! In a insert-trigger I have two joins on the table named inserted. Obviously this construction gives a name collition beetween the two joins (since both joins starts from the same table) Ofcourse I thougt the using bla JOIN bla ON bla bla bla AS a_different_name would work, but it does not. Is there a nice solution to this problem? Any help appriciated You are correct that you need to use an alias. The syntax requires the "AS alias" immediately after the table name: SELECT * FROM x AS A JOIN x AS B ON A.z = B.z JOIN x AS C ON A.z = B.z If you need more help, please post your code and explain what the problem is. Do you get an error message? -- David Portas SQL Server MVP -- ...

solution to ""ERROR: Output argument 'a' was not assigned during call to 'xlim'": Link to download xlim.m/ylim.m is not updated
Hi, I found technical solution to download new fixed xlim.m/ylim.m files in this adress: http://www.mathworks.com/support/solutions/en/data/1-19WWP/index.html?product=CO&solution=1-19WWP However they refering to a link to get the fixed files - but the link is not available any more. Do you know where I can download those files from? Thanks, Gilad "Gilad Asseraf" <gilad_asseraf@amat.com> wrote in message news:hsr9v6$333$1@fred.mathworks.com... > Hi, > I found technical solution to download new fixed xlim.m/ylim.m files in > this adress: &g...

There's "Unix", and then there's "UNIX(r)"
From TOW[1]: The Open Group, an industry standards consortium, now owns the UNIX trademark and allows its use for certified operating systems compliant with its standard, the Single UNIX Specification. Other operating systems that emulate Unix to some extent may be called Unix-like, although the Open Group disapproves of this term.[4] The term Unix is also often used informally to denote any operating system that closely resembles the trademarked system. The most common version of Unix (bearing certification) is Apple's OS X, while Linux is the most popular non-certified workalike. So, to summarize: "Unix" is a class of operating systems that is "UNIX-like", which includes Linux. "UNIX(r)" is a trademark of the Open group, who -- somewhat snootily -- have an issue with the term "UNIX-like". (They can take a flying fsck.) "Cult of Unix" spells "Unix" as "Unix", because otherwise, what would it have to do with Linux? This PSA brought to you by the letter "U" and the number "2". -v Unix minions, unite! On 2/9/14, 1:15 PM, in article ld8nlg$bu7$1@dont-email.me, "vallor" <vallor@cultnix.org> wrote: > From TOW[1]: > > The Open Group, an industry standards consortium, now owns the UNIX > trademark and allows its use for certified operating systems > compliant with its standard, the Single UN...

'Parse error' problem in "isset" and "empty"
I've been having some problems with a parse error that I can't figure out (PHP 4.3.11 on Solaris9). Sample code: <?php // getting strange parse errors on this class A { var $value; function A() { $this->value = 1; } function getValue() { return $this->value; } } $a = new A(); if (!empty($a->getValue())) { echo "success"; } else { echo "failure"; } ?> The result of this is: Parse error: parse error, unexpected '(', expecting ')' in /foo/public_html/parse_errors.php on line 15 I also get the same effect with "isset", however, testing with "is_null" or "is_int" produces the correct ("success"/"failure") result. Any ideas? /Marcin Check out the following: http://www.php.net/manual/en/function.empty.php empty() and isset() only work on variables. In your case, $a->getValue() is the return value of a function -- not a variable. You could do something like: $a = new A(); $v = $a->getValue(); if (!empty($v)) { echo "success"; } else { echo "failure"; } Alternatively, you could define your own isEmpty() function which does whatever you want. It could be as simple as: function isEmpty($value) { return (strlen($value) == 0); } Also, as of PHP 5.1 you can overload calls to empty() and isset() on object properties. Most useful when you also overload the getters and settings (via __get() and __set()). ...

Web resources about - "Select" & "Order By" OK- ''WHERE'' Does'nt Work ! - comp.lang.php

Resources last updated: 3/24/2016 6:09:27 AM