Re: Stumping Sql query...
On Wed, 23 Apr 2008 22:20:52 +0200, Rik Wasmus wrote:
It'll looks like that if the output is being viewed in a browser. The
whole "<BR>" thing is a bit of a hint that this is the case.
--
Either way, it'll remind the clued that there's only one letter
difference between 'turkey' and 'turnkey'.
-- Mike Andrews
On Wed, 23 Apr 2008 22:20:52 +0200, Rik Wasmus wrote:
On Wed, 23 Apr 2008 22:04:54 +0200, Guillaume Dargaud
><USE_MY_WEB_FO RM@gdargaud.net wrote:
>
>>
>The query gets printed here and it's (for instance):
>SELECT * FROM ImageList WHERE Name='MaceTrave rse'
>which when fed straight into PhpMyAdmin returns:
>Showing rows 0 - 0 (1 total, Query took 0.0004 sec)
>MaceTraverse Climbing/Arizona/MaceTraverse.jp g Arizona
>>
>For reference the table is defined as
>CREATE TABLE ImageList (
> Name VARCHAR(100) NOT NULL,
> Path VARCHAR(255) NOT NULL,
> Source TEXT,
>PRIMARY KEY (Name))
>>
>I just tried again after resetting Apache, and still no go.
>>
>If I add the following code to print everything:
>>
>$query="SELE CT * FROM ImageList";
>echo $query."|<BR>";
>$result=mysql_ query($query) or die(mysql_error ());
>while ($InContext=mys ql_fetch_assoc( $result)) { print_r($InCont ext); echo
>"<BR>"; }
>mysql_free_res ult($result);
>>
>Then among the output I DO get a line containing:
>Array ( [Name] =MaceTraverse [Path] =>
>Climbing/Arizona/MaceTraverse.jp g
>[Source] =Arizona )
>
Which is NOT the formatting print_r will deliver if you view it in the
source. It will have newlines.
><USE_MY_WEB_FO RM@gdargaud.net wrote:
>
>> $query="SELECT * FROM ImageList WHERE Name='$value[0]'";
>> $result=mysql_q uery($query, $DB) or die(mysql_error ());
>> if ($result) {
>> $InContext=mysq l_fetch_assoc($ result);
>> echo $query;
>> $result=mysql_q uery($query, $DB) or die(mysql_error ());
>> if ($result) {
>> $InContext=mysq l_fetch_assoc($ result);
>> echo $query;
>The query gets printed here and it's (for instance):
>SELECT * FROM ImageList WHERE Name='MaceTrave rse'
>which when fed straight into PhpMyAdmin returns:
>Showing rows 0 - 0 (1 total, Query took 0.0004 sec)
>MaceTraverse Climbing/Arizona/MaceTraverse.jp g Arizona
>>
>For reference the table is defined as
>CREATE TABLE ImageList (
> Name VARCHAR(100) NOT NULL,
> Path VARCHAR(255) NOT NULL,
> Source TEXT,
>PRIMARY KEY (Name))
>>
>I just tried again after resetting Apache, and still no go.
>>
>If I add the following code to print everything:
>>
>$query="SELE CT * FROM ImageList";
>echo $query."|<BR>";
>$result=mysql_ query($query) or die(mysql_error ());
>while ($InContext=mys ql_fetch_assoc( $result)) { print_r($InCont ext); echo
>"<BR>"; }
>mysql_free_res ult($result);
>>
>Then among the output I DO get a line containing:
>Array ( [Name] =MaceTraverse [Path] =>
>Climbing/Arizona/MaceTraverse.jp g
>[Source] =Arizona )
Which is NOT the formatting print_r will deliver if you view it in the
source. It will have newlines.
whole "<BR>" thing is a bit of a hint that this is the case.
Just, humor me, what happens if you do a $value[0] = trim($value[0]);
before making the $query string? And if that still doesn't work, examine
the _source_ of a possibly html browser you're using to check the query,
and maybe check in a hex editor what the ascii values are.
before making the $query string? And if that still doesn't work, examine
the _source_ of a possibly html browser you're using to check the query,
and maybe check in a hex editor what the ascii values are.
--
Either way, it'll remind the clued that there's only one letter
difference between 'turkey' and 'turnkey'.
-- Mike Andrews
Comment