Re: parse error in nested query - please help.
From: 'bonehead (senmenospam_at_here.org)
Date: 07/06/04
- Next message: Westcoast Sheri: "primary key vs unique key"
- Previous message: Aardwolf: "Php & Search engines"
- In reply to: Pedro Graca: "Re: parse error in nested query - please help."
- Next in thread: Polar: "Re: parse error in nested query - please help."
- Reply: Polar: "Re: parse error in nested query - please help."
- Reply: Geoff Berrow: "Re: parse error in nested query - please help."
- Reply: Pedro Graca: "Re: parse error in nested query - please help."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 05 Jul 2004 17:37:44 -0700
Pedro Graca wrote:
> I usually do (pseudo-code)
>
> <?php
> $query = "whatever";
> $result = mysql_query($query)
> or die('Error in query [' . $query . ']. The error was: ' . mysql_error());
> ?>
>
> Hint: is $_SESSION['username'] a string?
Okay I'll hazard a guess on this one. I haven't tested this particular
solution, but I've occasionally run into similar problems.
If Polar's $query is holding a string, is it possible that the php
expressions must be concatenated as they are in Pedro's example? For
instance, wouldn't you really need to do something like this:
$query = "UPDATE Submission SET reader='".{$_SESSION['username']}."',
date_processed=NOW(), accepted='Y' WHERE sub_id='".$row[0]."'";
Also, wouldn't you want to do something like
/*temporary error check line*/
echo $query;
Just to make sure the query looks the way it's supposed to?
Hope this helps.
- Next message: Westcoast Sheri: "primary key vs unique key"
- Previous message: Aardwolf: "Php & Search engines"
- In reply to: Pedro Graca: "Re: parse error in nested query - please help."
- Next in thread: Polar: "Re: parse error in nested query - please help."
- Reply: Polar: "Re: parse error in nested query - please help."
- Reply: Geoff Berrow: "Re: parse error in nested query - please help."
- Reply: Pedro Graca: "Re: parse error in nested query - please help."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|