MySQL Forums
Forum List  »  PHP

Re: Submit form Problems
Posted by: Jonathan Stephens
Date: June 08, 2005 09:00AM

2 problems:

1. Syntax error in the INSERT. See http://dev.mysql.com/doc/mysql/en/INSERT.html

2. You need to insert the values held in the POST variables. So your query should use those variables.

Instead of this:

$query = "INSERT INTO ts1news (ts1_title, ts1_subtitle, ts1_summary, ts1_story)";

try this:

extract($_POST); # see php.net/extract for info
$query = "INSERT INTO ts1news VALUES ('$ts1_title', '$ts1_subtitle', '$ts1_summary', '$ts1_story')";

Jon Stephens
MySQL Documentation Team @ Oracle

MySQL Dev Zone
MySQL Server Documentation
Oracle

Options: ReplyQuote


Subject
Written By
Posted
June 08, 2005 07:50AM
Re: Submit form Problems
June 08, 2005 09:00AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.