Re: [PHP-DB] 2 Questions... INSERT and searching records....

2002-01-31 Thread Jason Wong

On Friday 01 February 2002 02:42, Todd Williamsen wrote:
 It seems that my insert statement doesn't want to cooperate..  I used the
 same format as in Julie Meloni's book.  I know, sometimes, her code doesn't
 always work either.

 here it is:

 $sql = INSERT INTO Jobs (id, Industry, Other, JobTitle, Description,
 Location, Date)
  VALUES
  (\\,
  \$id\, \$Industry\, \$Other\, \$JobTitle\, \$Description\,
 \$Location\, \$Date\);
  $result = @mysql_query($sql) or die(OOPS!!  Couldn't Execute Query!);
  ?

 its not the whole code block... it dies and executes the OOPS!!  Couldn't
 Execute Query! statement.
 what is wrong... anybody?  Bueller?


Try using single quotes:

 $sql = INSERT INTO Jobs (id, Industry, Other, JobTitle, Description,
 Location, Date)
  VALUES
  ('',
  '$id', '$Industry', '$Other', '$JobTitle', '$Description',
 '$Location', '$Date');



-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
To fear love is to fear life, and those who fear life are already three
parts dead.
-- Bertrand Russell
*/

-- 
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] 2 Questions... INSERT and searching records....

2002-01-31 Thread Rick Emery

And the problem is...

You are trying to insert 8 values into 7 fields.  You begin your VALUES with
, but there is not field specified for it.

Don't blame Meloni here until you've proven her wrong.

-Original Message-
From: Todd Williamsen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 31, 2002 12:43 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] 2 Questions... INSERT and searching records


It seems that my insert statement doesn't want to cooperate..  I used the
same format as in Julie Meloni's book.  I know, sometimes, her code doesn't
always work either.

here it is:

$sql = INSERT INTO Jobs (id, Industry, Other, JobTitle, Description,
Location, Date)
 VALUES
 (\\,
 \$id\, \$Industry\, \$Other\, \$JobTitle\, \$Description\,
\$Location\, \$Date\);
 $result = @mysql_query($sql) or die(OOPS!!  Couldn't Execute Query!);
 ?

its not the whole code block... it dies and executes the OOPS!!  Couldn't
Execute Query! statement.
what is wrong... anybody?  Bueller?



-- 
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] 2 Questions... INSERT and searching records....

2002-01-31 Thread Rick Emery

 Remove the \\.

Next, whenever you have a problem with a query, print mysql_error() as part
of your die() statement.  Finally, print your $sql to ensure that it
contains what you expect.

-Original Message-
From: Todd Williamsen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 31, 2002 1:05 PM
To: 'Rick Emery'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] 2 Questions... INSERT and searching records


I pulled that code right out of her book...same thing

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 31, 2002 1:02 PM
To: 'Todd Williamsen'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] 2 Questions... INSERT and searching records


And the problem is...

You are trying to insert 8 values into 7 fields.  You begin your VALUES
with
, but there is not field specified for it.

Don't blame Meloni here until you've proven her wrong.

-Original Message-
From: Todd Williamsen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 31, 2002 12:43 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] 2 Questions... INSERT and searching records


It seems that my insert statement doesn't want to cooperate..  I used
the
same format as in Julie Meloni's book.  I know, sometimes, her code
doesn't
always work either.

here it is:

$sql = INSERT INTO Jobs (id, Industry, Other, JobTitle, Description,
Location, Date)
 VALUES
 (\\,
 \$id\, \$Industry\, \$Other\, \$JobTitle\, \$Description\,
\$Location\, \$Date\);
 $result = @mysql_query($sql) or die(OOPS!!  Couldn't Execute Query!);
 ?

its not the whole code block... it dies and executes the OOPS!!
Couldn't
Execute Query! statement.
what is wrong... anybody?  Bueller?



-- 
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]