RE: [PHP-DB] PLEASE HELP! Problem with ODBC string insert

2001-07-15 Thread Matthew Loff


It might help us to see exactly what the query is...

Could you insert an echo statement and let us know what SQL query it's
producing?

echo 
INSERT INTO News
   (NewsDate,NewsTitle,NewsText)
VALUES
('$NowDate','$NewsTitle','$NewsText')
;


-Original Message-
From: AKA Hook [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 15, 2001 1:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] PLEASE HELP! Problem with ODBC string insert


I am using an Access DBASE and trying to insert text from a form field.
When I use quotes in my text the code errors out, otherwise it works
fine. I have Magic Quotes turned on which is supposed to fix this
problem but IT DOES NOT!

I have posted in several forums but no one has been able to help me!
Here is my code:


--

$NowDate = date(m/d/y);

$DBASE = odbc_connect(mno,admin,admin);
$getnews = odbc_exec($DBASE,

INSERT INTO News
   (NewsDate,NewsTitle,NewsText)
VALUES
('$NowDate','$NewsTitle','$NewsText')

);

Here is the error when using quotes in the NewsText form field:



Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax
error (missing operator) in query expression ''can\'t use quotes!')'.,
SQL state 37000 in SQLExecDirect in W:\www\clanmno\news_post2.php on
line 22

Thanks in advance...





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PLEASE HELP! Problem with ODBC string insert

2001-07-15 Thread AKA Hook

Here is the echo output.

UPDATE News SET NewsTitle = 'Text',
NewsText = 'can\'t use quotes!' WHERE NewsID = 16


Matthew Loff [EMAIL PROTECTED] wrote in message
000e01c10d89$6fa576c0$0100a8c0@bang">news:000e01c10d89$6fa576c0$0100a8c0@bang...

 It might help us to see exactly what the query is...

 Could you insert an echo statement and let us know what SQL query it's
 producing?

 echo 
 INSERT INTO News
(NewsDate,NewsTitle,NewsText)
 VALUES
 ('$NowDate','$NewsTitle','$NewsText')
 ;


 -Original Message-
 From: AKA Hook [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, July 15, 2001 1:03 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] PLEASE HELP! Problem with ODBC string insert


 I am using an Access DBASE and trying to insert text from a form field.
 When I use quotes in my text the code errors out, otherwise it works
 fine. I have Magic Quotes turned on which is supposed to fix this
 problem but IT DOES NOT!

 I have posted in several forums but no one has been able to help me!
 Here is my code:
 
 
 --

 $NowDate = date(m/d/y);

 $DBASE = odbc_connect(mno,admin,admin);
 $getnews = odbc_exec($DBASE,
 
 INSERT INTO News
(NewsDate,NewsTitle,NewsText)
 VALUES
 ('$NowDate','$NewsTitle','$NewsText')
 
 );

 Here is the error when using quotes in the NewsText form field:
 
 
 
 Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax
 error (missing operator) in query expression ''can\'t use quotes!')'.,
 SQL state 37000 in SQLExecDirect in W:\www\clanmno\news_post2.php on
 line 22

 Thanks in advance...





 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] PLEASE HELP! Problem with ODBC string insert

2001-07-15 Thread Matthew Loff



That looks like a valid query to me...  I know this would break SQL92
standard, but have you tried enclosing the values in double quotes?  I
know that's valid with MySQL...  

I don't have any other suggestions... Does anyone else?


-Original Message-
From: AKA Hook [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 15, 2001 3:56 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] PLEASE HELP! Problem with ODBC string insert


Here is the echo output.

UPDATE News SET NewsTitle = 'Text',
NewsText = 'can\'t use quotes!' WHERE NewsID = 16


Matthew Loff [EMAIL PROTECTED] wrote in message
000e01c10d89$6fa576c0$0100a8c0@bang">news:000e01c10d89$6fa576c0$0100a8c0@bang...

 It might help us to see exactly what the query is...

 Could you insert an echo statement and let us know what SQL query it's

 producing?

 echo 
 INSERT INTO News
(NewsDate,NewsTitle,NewsText)
 VALUES
 ('$NowDate','$NewsTitle','$NewsText')
 ;


 -Original Message-
 From: AKA Hook [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, July 15, 2001 1:03 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] PLEASE HELP! Problem with ODBC string insert


 I am using an Access DBASE and trying to insert text from a form 
 field. When I use quotes in my text the code errors out, otherwise it 
 works fine. I have Magic Quotes turned on which is supposed to fix 
 this problem but IT DOES NOT!

 I have posted in several forums but no one has been able to help me! 
 Here is my code:
 --
 --
 
 --

 $NowDate = date(m/d/y);

 $DBASE = odbc_connect(mno,admin,admin);
 $getnews = odbc_exec($DBASE,
 
 INSERT INTO News
(NewsDate,NewsTitle,NewsText)
 VALUES
 ('$NowDate','$NewsTitle','$NewsText')
 
 );

 Here is the error when using quotes in the NewsText form field:
 --
 --
 
 
 Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax
 error (missing operator) in query expression ''can\'t use quotes!')'.,
 SQL state 37000 in SQLExecDirect in W:\www\clanmno\news_post2.php on
 line 22

 Thanks in advance...





 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PLEASE HELP! Problem with ODBC string insert

2001-07-15 Thread AKA Hook

I tried double quotes and many different combinations of single and
double but nothing has worked.

There HAS to be an answer out there! Do certain SQL statements just not work
in PHP / Access? Is this a bug in Access or PHP?

If I can't get this to work then I won't be able to use PHP for this site!
Someone please shed some light on this!

Matthew Loff [EMAIL PROTECTED] wrote in message
001701c10dae$53146280$0100a8c0@bang">news:001701c10dae$53146280$0100a8c0@bang...


 That looks like a valid query to me...  I know this would break SQL92
 standard, but have you tried enclosing the values in double quotes?  I
 know that's valid with MySQL...

 I don't have any other suggestions... Does anyone else?


 -Original Message-
 From: AKA Hook [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, July 15, 2001 3:56 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] PLEASE HELP! Problem with ODBC string insert


 Here is the echo output.

 UPDATE News SET NewsTitle = 'Text',
 NewsText = 'can\'t use quotes!' WHERE NewsID = 16


 Matthew Loff [EMAIL PROTECTED] wrote in message
 000e01c10d89$6fa576c0$0100a8c0@bang">news:000e01c10d89$6fa576c0$0100a8c0@bang...
 
  It might help us to see exactly what the query is...
 
  Could you insert an echo statement and let us know what SQL query it's

  producing?
 
  echo 
  INSERT INTO News
 (NewsDate,NewsTitle,NewsText)
  VALUES
  ('$NowDate','$NewsTitle','$NewsText')
  ;
 
 
  -Original Message-
  From: AKA Hook [mailto:[EMAIL PROTECTED]]
  Sent: Sunday, July 15, 2001 1:03 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] PLEASE HELP! Problem with ODBC string insert
 
 
  I am using an Access DBASE and trying to insert text from a form
  field. When I use quotes in my text the code errors out, otherwise it
  works fine. I have Magic Quotes turned on which is supposed to fix
  this problem but IT DOES NOT!
 
  I have posted in several forums but no one has been able to help me!
  Here is my code:
  --
  --
  
  --
 
  $NowDate = date(m/d/y);
 
  $DBASE = odbc_connect(mno,admin,admin);
  $getnews = odbc_exec($DBASE,
  
  INSERT INTO News
 (NewsDate,NewsTitle,NewsText)
  VALUES
  ('$NowDate','$NewsTitle','$NewsText')
  
  );
 
  Here is the error when using quotes in the NewsText form field:
  --
  --
  
  
  Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax
  error (missing operator) in query expression ''can\'t use quotes!')'.,
  SQL state 37000 in SQLExecDirect in W:\www\clanmno\news_post2.php on
  line 22
 
  Thanks in advance...
 
 
 
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
  [EMAIL PROTECTED]
 



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] PLEASE HELP! Problem with ODBC string insert

2001-07-15 Thread Matthew Loff


It would be a hack, but if the data is only going to be used for the
site (e.g. nobody is going to use the data through access) you could
str_replace() the single quote to something else (perhaps an HTML ASCII
representation like #;) before the INSERT/UPDATE, and converting
back when SELECTing.  It's ugly, but it would work...


-Original Message-
From: AKA Hook [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 15, 2001 7:21 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] PLEASE HELP! Problem with ODBC string insert


I tried double quotes and many different combinations of single and
double but nothing has worked.

There HAS to be an answer out there! Do certain SQL statements just not
work in PHP / Access? Is this a bug in Access or PHP?

If I can't get this to work then I won't be able to use PHP for this
site! Someone please shed some light on this!

Matthew Loff [EMAIL PROTECTED] wrote in message
001701c10dae$53146280$0100a8c0@bang">news:001701c10dae$53146280$0100a8c0@bang...


 That looks like a valid query to me...  I know this would break SQL92 
 standard, but have you tried enclosing the values in double quotes?  I

 know that's valid with MySQL...

 I don't have any other suggestions... Does anyone else?


 -Original Message-
 From: AKA Hook [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, July 15, 2001 3:56 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] PLEASE HELP! Problem with ODBC string insert


 Here is the echo output.

 UPDATE News SET NewsTitle = 'Text',
 NewsText = 'can\'t use quotes!' WHERE NewsID = 16


 Matthew Loff [EMAIL PROTECTED] wrote in message 
 000e01c10d89$6fa576c0$0100a8c0@bang">news:000e01c10d89$6fa576c0$0100a8c0@bang...
 
  It might help us to see exactly what the query is...
 
  Could you insert an echo statement and let us know what SQL query 
  it's

  producing?
 
  echo 
  INSERT INTO News
 (NewsDate,NewsTitle,NewsText)
  VALUES
  ('$NowDate','$NewsTitle','$NewsText')
  ;
 
 
  -Original Message-
  From: AKA Hook [mailto:[EMAIL PROTECTED]]
  Sent: Sunday, July 15, 2001 1:03 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] PLEASE HELP! Problem with ODBC string insert
 
 
  I am using an Access DBASE and trying to insert text from a form 
  field. When I use quotes in my text the code errors out, otherwise 
  it works fine. I have Magic Quotes turned on which is supposed to 
  fix this problem but IT DOES NOT!
 
  I have posted in several forums but no one has been able to help me!

  Here is my code:
  
  --
  --
  
  --
 
  $NowDate = date(m/d/y);
 
  $DBASE = odbc_connect(mno,admin,admin);
  $getnews = odbc_exec($DBASE,
  
  INSERT INTO News
 (NewsDate,NewsTitle,NewsText)
  VALUES
  ('$NowDate','$NewsTitle','$NewsText')
  
  );
 
  Here is the error when using quotes in the NewsText form field:
  
  --
  --
  
  
  Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax
  error (missing operator) in query expression ''can\'t use
quotes!')'.,
  SQL state 37000 in SQLExecDirect in W:\www\clanmno\news_post2.php on
  line 22
 
  Thanks in advance...
 
 
 
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED] For 
  additional commands, e-mail: [EMAIL PROTECTED] To contact 
  the list administrators, e-mail: [EMAIL PROTECTED]
 



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
[EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]