--- John Holmes <[EMAIL PROTECTED]> wrote:
> Stuart Felenstein wrote:
> Print out the entire query before you run it. Syntax
> errors are usually
> pretty obvious. If not, post the actual query here.
I found one possible syntax error and fixed it though
it seemed to have no effect. I'm postin
--- Bastien Koert <[EMAIL PROTECTED]> wrote:
>
> can you post the code that creates the sql
> statement
>
> bastien
>
I'm posting the entire script. I hope it comes
through legible. If not I can do an attachment so the
format, line breaks will remain.
0 AND is_array($taxType)) {
$s_
One observation:
> print_r($query_rsCS);
> if(!empty($aWHERE));
^ Remove semi-colon ?
> $query_rsCS .= ' WHERE '.implode(' AND ',$aWHERE);
> print_r($aWHERE);
HTH
Graham
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.
--- Graham Cossey <[EMAIL PROTECTED]> wrote:
> One observation:
>
> > print_r($query_rsCS);
> > if(!empty($aWHERE));
> ^ Remove
> semi-colon ?
>
> > $query_rsCS .= ' WHERE '.implode(' AND ',$aWHERE);
> > print_r($aWHERE);
>
> HTH
>
> Graham
>
Didn't do it. :
Stuart Felenstein wrote:
if(isset($stateReloc2)) $aWHERE[] = "Prof.State1 IN
($stateReloc2)";
You need to check if $stateReloc2, etc are empty() instead of set.
If the variable is set, but empty, you're going to end up with a
query like "Prof.State1 IN ()" which will cause your error, which
we woul
--- John Holmes <[EMAIL PROTECTED]> wrote:
> Stuart Felenstein wrote:
> > if(isset($stateReloc2)) $aWHERE[] = "Prof.State1
> IN
> > ($stateReloc2)";
>
> You need to check if $stateReloc2, etc are empty()
> instead of set.
> If the variable is set, but empty, you're going to
> end up with a
> que
--- John Holmes <[EMAIL PROTECTED]> wrote:
> You need to check if $stateReloc2, etc are empty()
> instead of set.
> If the variable is set, but empty, you're going to
> end up with a
> query like "Prof.State1 IN ()" which will cause your
> error, which
> we would have seen if you'd just posted th
John! Your the man! It works!
if (!empty(var))
Excellent. I think this is a good lesson in isset. I
assumed they were the same. I guess reading the
manual more would help.
Thank you.
Stuart
> --- John Holmes <[EMAIL PROTECTED]> wrote:
>
> > You need to check if $stateReloc2, etc are empty()
The following script:
Share the fun!
Your email: $v already in the list";
}
else {
$sql_in = "INSERT INT
To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm
On 03 December 2004 13:15, Yemi Obembe wrote:
> $sql = "SELECT * FROM arcadia WHERE email=$v";
>$sql_in = "INSERT INTO arcadia ('email') VALUES ('$v')";
Spot the difference:
Hello I have a application that has an insert query (using a mysql
database) and I am having an issue with trying to combine three fields
with a dash . Here is my code can anyone please help me out with what
else I need to add or point me to somewhere that explains how to combine
field's in a
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
> '{$_POST['PO_Year']}-{$_POST['PO_Month']}-{$_POST['PO_Day']}'
"{$_POST['PO_Year']}-{$_POST['PO_Month']}-{$_POST['PO_Day']}"
Variables aren't evaluated in single quotes.
- Martin Norland, Database / Web Developer, Int
I want to send back a message when no matches are
found on my search page. Basically "No matches
found". I assumed that mysql_fetch_assoc would be the
determining factor on whether any rows will come back.
As you can see below I do a if ($row_rsCS == false).
Apparently though (while the message
You might want to use:
mysql_num_rows -- Get number of rows in
result
Stuart Felenstein wrote:
I want to send back a message when no matches are
found on my search page. Basically "No matches
found". I assumed that mysql_fetch_assoc would be the
determining factor on whether any rows will com
To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm
On 03 December 2004 14:39, Stuart Felenstein wrote:
> I want to send back a message when no matches are
> found on my search page. Basically "No matches
> found". I assumed that m
> The closing ?> of a PHP segment also implies an
> end-of-statement semicolon
> -- so the above is equivalent to:
>
>if ($row_rsCS == false) ;
>?>
>
> Which, of course, means that the scope of the if
> doesn't extend to anything
> beyond this point.
>
> You need to mark the block contro
wouldn't it be
$_POST['PO_Year']."-".$_POST['PO_Month']."-".$_POST['PO_Day']
?
metin
[EMAIL PROTECTED] wrote:
Hello I have a application that has an insert query (using a mysql
database) and I am having an issue with trying to combine three fields
with a dash . Here is my code can anyone plea
--- Stuart Felenstein <[EMAIL PROTECTED]> wrote:
> The reason the close is there is because the next
> line
> of code is the print_r , and I put some html in
> there.
>
So this works great:
if ($row_rsCS == false) {
print_r ("No Matches Found");
exit;
}
But because I want to have some html f
To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm
On 03 December 2004 15:06, Stuart Felenstein wrote:
> > The closing ?> of a PHP segment also implies an
> > end-of-statement semicolon
> > -- so the above is equivalent to:
> >
> >
To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm
On 03 December 2004 15:16, Stuart Felenstein wrote:
> --- Stuart Felenstein <[EMAIL PROTECTED]> wrote:
>
> > The reason the close is there is because the next
> > line
> > of code
--- "Ford, Mike" <[EMAIL PROTECTED]> wrote:
> Well, your taste seems to be to use { }, so :-endif
> is irrelevant.
>
Alright it's Friday, I'm punchy but we're all in a
good mood !
Yes, I like the closing curlies
So, then where do these lovely ladies go here ?
if ($row_rsCS == false) {
exit;
To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm
On 03 December 2004 15:26, Stuart Felenstein wrote:
> --- "Ford, Mike" <[EMAIL PROTECTED]> wrote:
>
> > Well, your taste seems to be to use { }, so :-endif is irrelevant.
> >
> Al
To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm
On 03 December 2004 15:26, Stuart Felenstein wrote:
> --- "Ford, Mike" <[EMAIL PROTECTED]> wrote:
>
> > Well, your taste seems to be to use { }, so :-endif is irrelevant.
> >
> Al
or use concat_ws (concatenation with separator)
concat_ws('-',{$_POST['PO_Year']},{$_POST['PO_Month']},{$_POST['PO_Day']})
bastien
ps. I strongly recommend validating data before you insert into the db
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Concat 3 fields in a query
Date:
--- "Ford, Mike" <[EMAIL PROTECTED]> wrote:
> And, by the way, why on earth are you using a
> print_r an a straight literal
> string? Seems to me you could just put that text in
> as part of the HTML:
>
>if ($row_rsCS == false) {
>?>
> No Matches
> Found
> exit;
>}
>
-Original Message-
From: Bastien Koert [mailto:[EMAIL PROTECTED]
>
concat_ws('-',{$_POST['PO_Year']},{$_POST['PO_Month']},{$_POST['PO_Day']
})
I'm pretty sure this will error because of the unneccessary {}'s around
the POST array items. PHP really doesn't like you using extra curlies
arou
Thanks to all that responded to this thread I learned from it.
I actually validate the data before it even gets to the insert or update
statment to make sure there are no evil characters out there trying to
cause me pain.
I do have one more question I fixed the insert query now onto the update
Good suggestion Anna, that's what we do for AllNovaScotia.com, plus we add
this bit of .css
@media print { body { display: none; } }
Then viewer can't print the page. We do this because only certain
subscribers have printing privileges.
Regards - Miles Thompson
At 03:31 PM 12/1
Hi All,
I'm looking at data abstraction libraries, and various object wrappers
for SQL interfaces. Question -- how does the PEAR DB abstraction handle
JOINS, especially on updates. I've seen several abstractions that
basically encapsulate one table, but what about the situation with
multiple
http://www.php.net/manual/
http://www.php.net/manual/en/language.types.string.php
Basically:
* quoting with ' is when you just literally want that string
output.
You can't call functions or print variables values within it.
e.g.print 'hello_world() $name';
the concat_ws command is mysql specific...it only works in a sql statement.
if you want to do this in code then
PO_Date= $_POST['PO_Year'].'-'.$_POST['PO_Month'].'-'.$_POST['PO_Day'])';
will work
bastien
From: [EMAIL PROTECTED]
To: <[EMAIL PROTECTED]>
Subject: RE: [PHP-DB] Concat 3 fields in a quer
Thank you again for the help. I have constructed my sql statements and am
able to insert and update the data with the help everyone's feedback.
Martin, thanks for the little turotial on strings it makes sense now and
sorry if I mis-posted my question to this list.
Khris
"Norland, Martin" <[
hi
i am trying to find(search) an entry in the
inventory data base system ...i want to find the entry
based on the "tagno" since this is the primary key in
my table..
the logic i had written is
if(isset($_POST['submit'])) {
if (!empty($_POST['tagno']))
{
$insquery ="select
agno=(\"".sqlite
Hello,
How can i get, in PHP, de value from a textarea, using the POST-method.
$_POST['var'] doesn't seem to work...
tnx in advance,
Henk Jan
_
Play online games with your friends with MSN Messenger
http://messenger.msn.nl/
--
PHP
Hello,
Does anyone know how i can get a value, in PHP, from a textarea, using the
POST method?
Thnx in advance!!
Henk Jan
_
Hotmail en Messenger on the move
http://www.msn.nl/communicatie/smsdiensten/hotmailsmsv2/
--
PHP Database M
show code
bastien
From: "H. J. Wils" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [PHP-DB] POST-value form a textarea
Date: Fri, 03 Dec 2004 22:17:08 +0100
Hello,
How can i get, in PHP, de value from a textarea, using the POST-method.
$_POST['var'] doesn't seem to work...
tnx in advance,
He
$_SESSION['txt'] = $_POST['Body'];
gr henk jan
From: "Bastien Koert" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: RE: [PHP-DB] POST-value form a textarea
Date: Fri, 03 Dec 2004 16:58:11 -0500
MIME-Version: 1.0
X-Originating-IP: [66.38.136.63]
X-Originating-Email: [EMAIL PRO
simplified, my code is as follows:
document
--
$_SESSION['mailtxt'] = $_POST['Body'];
?>
recalling: in some way, is de session variable not filled with the POSTed
value...
You aren't actually outputting the $_SESSION['mailtxt'] var..
Try using echo ;-)
/ oscar
-Original Message-
From: H. J. Wils [mailto:[EMAIL PROTECTED]
Sent: den 3 december 2004 23:09
To: [EMAIL PROTECTED]
Subject: [PHP-DB] POST problem, extended
simplified, my code is as follows:
forgotten... off course I use the echo... :-)
in some strange way, it only works with a limited size of charactes in the
sended variable :-S
From: "Oscar Rylin" <[EMAIL PROTECTED]>
To: "'H. J. Wils'" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
Subject: RE: [PHP-DB] POST problem, extended
Date: Fri
Are you doing a session_start(); before setting the session variable and
each page trying to access it?
-Original Message-
From: H. J. Wils [mailto:[EMAIL PROTECTED]
Sent: Friday, December 03, 2004 4:12 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] POST problem, extended
forgotten... o
I do!
From: "Neal Carmine" <[EMAIL PROTECTED]>
To: "'H. J. Wils'" <[EMAIL PROTECTED]>,<[EMAIL PROTECTED]>
Subject: RE: [PHP-DB] POST problem, extended
Date: Fri, 3 Dec 2004 16:19:15 -0700
MIME-Version: 1.0
Received: from mc7-f41.hotmail.com ([65.54.253.48]) by mc7-s18.hotmail.com
with Microsoft SM
session_start(); //session start needs to be on every page that uses
sessions
if (isset($_POST['Body'])){ $_SESSION['mailtxt'] = $_POST['Body']; }
?>
From: "H. J. Wils" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [PHP-DB] POST problem, extended
Date: Fri, 03 Dec 2004 23:09:18 +0100
si
try posting the whole damn script...how the hell else are we supposed to
help you? Maybe 'cause its friday, nut my mind reading skills are not
working well
bastien
From: "H. J. Wils" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] POST problem, extended
Date: Sat, 04 Dec 2004 02:
ok,
to brighten everything a bit :-)
te code below is pseudo-code, that means use session_start(); in the correct
way. I use the echo, to output the data.
More over, the code works fine for small sized variables, but whit huge
data, thats why i use the post method, it doesn't seam to work any mo
So here's the problem: I can connect to a mySQL database on localhost just
fine with a PHP test script I've written, but I cannot connect to a remote
server, even though I can connect to the remote server just fine with
mySQL Control Center. Anybody have any suggestions? Here's a snippet of my
code
do you have the same user with the same permissions as the mysql cc user?
bastien
From: Bryan Green <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [PHP-DB] mySQL - can connect with mysqlcc but not PHP code
Date: Fri, 03 Dec 2004 12:52:53 -0800
So here's the problem: I can connect to a mySQL dat
47 matches
Mail list logo